Hi,

I'm trying to implement some kind of "finally" behavior in a process 
definition.

My workflow needs to prepare an environment by suspending various resources 
and eventually resuming them.
I've written the actual code (participants) that suspend and resume the 
resources, and a small working workflow but I felt it's a bit loosely 
described.

The workflow is roughly described like this:

define do
  resource1 :action => 'suspend'
  resource2 :action => 'suspend'
  
  do_some_stuff

  resource2 :action => 'resume'
  resource1 :action => 'resume'
end

Resources 1 and 2 are not coupled or dependent on each other, but the 
resume/suspend operations are.
I feel this is a bit loose because some action inside do_some_stuff might 
cause the workflow to skip resuming, plus they are too far apart :)

I re-arranged it with `apply` like so:

define do
  define 'prepare_resource1' do
    resource1 :action => 'suspend'
    apply
    resource1 :action => 'resume'
  end
  define 'prepare_resource2' do
    resource2 :action => 'suspend'
    apply
    resource2 :action => 'resume'
  end
  
  prepare_resource1 do
    prepare_resource2 do
      do_some_stuff
    end
  end
end

I like it better, but it still feels a bit off to me, not sure why. Maybe 
too much nesting or something.
I might be way off, and the first workflow is the way to go. :)

Help is much appreciated, thanks.

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"ruote" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to