On Fri, Jan 28, 2011 at 10:46:05AM -0800, Raphael Simon wrote:
>
> x :filter => { :in => [ 'field.sub_field' => 'sub_process_field',
> 'array_field[2]' => 'another_sub_process_field' ] }
>
> Ideally the syntax should be consistent with the 'WorkItem#lookup' syntax
> (so you can document it / implement it as doing a standard lookup in the
> workitem and assigning the result to the workitem being passed to the
> participant).
>
> Please let me know if I can help with code reviews or testing as you make
> progress.
Hello Raphael,
I've started work on the 'filter' :
https://github.com/jmettraux/ruote/commit/afc772cbe022a617a7846615aeddab1af016d847
For now, a filter looks like :
[
{ 'field' => 'x', 'default' => 1 },
{ 'field' => 'y', 'remove' => true }
]
I was wondering about an alternate (transposed) variant for the filters :
{
'require' => [ 'x', 'y', 'z' ],
'remove' => [ 'a', 'b' ],
'copy' => { 'c' => 'd', 'e' => 'f' },
'default' => { 'g' => {}, 'h' => "twelve" }
}
The two formats could coexist (though since order matters, we couldn't have
strict equality...). Well, for now I'm going with the first version (list of
rules).
I think I'll go on with mixing validation and transformation. It's OK. When I
look at your filter at
https://gist.github.com/799298
I wonder if I should use a field_error like you do and place the process
instance in error or simply raise an error on the first error encountered when
filtering.
I also found
http://json-schema.org/
http://tools.ietf.org/html/draft-zyp-json-schema-03
and two ruby implementations
https://github.com/Constellation/ruby-jsonchema
https://github.com/hoxworth/json-schema (active)
Looking for it, at least as an inspiration, for the validation aspect of
filters. (of course, your gist is in as well).
Cheers,
--
John Mettraux - http://jmettraux.wordpress.com
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en