on_cancel or on_error for cancellation strategy

25 views
Skip to first unread message

ddeng

unread,
Jun 18, 2012, 4:31:57 PM6/18/12
to openwfe...@googlegroups.com
I have some qusestions about exception/cancelation handling strategy in Ruote.  On the documentation http://ruote.rubyforge.org/patterns.html#cancellationc it's still "coming soon"
I met the following case:
sequence do
  alice :work_id=>"111"
  bob   :work_id=>"222"
end

I am looking for the proper way to handle the situation where alice or bob may not be able to finish the given jobs, then the process can be terminated and the reason of the termination can be properly captured.


So I came up with following solutions, but not sure which is the proper way to do that:

1. cancel the process directly by calling Dashboard#cancel
2. cancel the workitem by calling Dashboard#cancel , but in this case, I found bob will still get the workitem.
3. add some expression in the definition, like 
     cancel if ${f:status == "failed"}
   I found this tedious and cumbersome for dynamic generated definitions...

So, what is the proper cancellation strategy?

Thanks!


ddeng

unread,
Jun 18, 2012, 4:49:49 PM6/18/12
to openwfe...@googlegroups.com
BTW, how to throw an error manually given a work item?

John Mettraux

unread,
Jun 18, 2012, 7:22:01 PM6/18/12
to openwfe...@googlegroups.com
On Mon, Jun 18, 2012 at 01:49:49PM -0700, ddeng wrote:
> BTW, how to throw an error manually given a work item?

Hello Deng,

two threads to discuss this issue, that's one thread too much.

I suggest

---8<---
sequence do
alice :work_id=>"111"
bob :work_id=>"222"
end
--->8---

And I'll bring you the trick to emit errors from storage participants
tomorrow, in the other thread.


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

Reply all
Reply to author
Forward
0 new messages