Hello Gonzalo,
What does "it isn't working for me" means ?
Your process definition holds two sub-process definitions but has no
body, could it be that ? Running that process would do nothing.
> 2. When the ':on_cancel' process is fired up ('update_database'),
> first dispatch to a participant delivers an empty payload. I would
> like the new process (called by :on_cancel) to be able to check if the
> latest payload held a special variable and if so do some jobs with it.
OK, so it seems that it works somehow :-)
Yes, the philosophy is currently (in ruote 0.9 and 2.0) that on_cancel
and on_error use the workitem as found at apply_time (not a reply
time). In ruote 2.0, the cancel mechanism would imply that in case of
a concurrence the last child to reply would have its workitem win the
"cancelling merge", to avoid that indetermination, the workitem at
apply time (root towards leaf) is used. Of course this is debatable,
I'm open to suggestions.
When the on_cancel covered zone (process segment / branch), there
should be enough information to cancel / roll back further changes.
Ideally...
You could eventually go via process variables instead of workitem
fields, or put the on_cancel much closer to the participant which sets
your fields (eventually splitting the on_cancel work).
> It would be something like if :on_cancel could select a participant
> expression a get its current payload:
>
> sequence :on_cancel => "call_subprocess", :local =>
> "<participant_expression>"
> [...]
> end
>
> I know this can't be exactly this way because :on_cancel event may
> happen anytime and <participant_expression> may or may not exist at
> that moment...
Indeed, that's a problem.
Maybe you could explain the whole use case, there is maybe another
solution, something other than on_cancel.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
Hello Gonzalo,
my mistake : ruote-rest has some weak points when it gets to
subprocesses. I have to fix that.
IIRC, you already pointed to some of those issues 2 months ago.
Thanks a lot,
Still have to fix that new "version" of the issue though :(
Hello Gonzalo,
this is right : the process is still the main "...poyoyu".
> Then I do a GET on that
> process (GET processes/20091019-godepoyoyu) and shows up the following
> error:
>
> undefined method `each' for nil:NilClass
> (erb):27:in `get_binding'
I have added a small test [1] for that case. But it doesn't fail. Am I
not doing it right ? Should I really try with an on_cancel subprocess
? Or maybe are we not using the same version of ruote / ruote-rest ?
[1] http://github.com/jmettraux/ruote-rest/blob/master/test/ft_subprocesses.rb#L42-45
Cheers,
Hello Gonzalo,
I'm quite busy for now, I wil try to build a test case with all the
information you gave me and try to fix that next week.
Sorry for the delay, many thanks,
sorry for the 12 days delay. I came up with a solution (in ruote itself) :
http://github.com/jmettraux/ruote/commit/bbb90e68d5399a2a62c020b83ecf65403ac0f75d
with the assorted test :
http://github.com/jmettraux/ruote-rest/commit/1a56bd3fb72150f14e2f3fef6c90a306217bca0b
Not 100% happy with the solution : if the process instance splits in
two independent subprocesses only one of them will get shown in
/processes/wfid. It's OK for your use case now. I'm working on a 100%
solution starting with ruote 2.0
Sorry again,