examples/about_state.rb in ruote-0.9.18 vs examples/about_state.rb in ruote-0.9.19

- old
+ new

@@ -12,70 +12,70 @@ require 'openwfe/participants' engine = OpenWFE::Engine.new alice = engine.register_participant( - :alice, OpenWFE::HashParticipant) + :alice, OpenWFE::HashParticipant) bob = engine.register_participant( - :bob, OpenWFE::HashParticipant) + :bob, OpenWFE::HashParticipant) class MyDefinition < OpenWFE::ProcessDefinition - sequence do - alice - bob - end + sequence do + alice + bob + end end # later ... #fei = engine.launch MyDefinition # #sleep 0.050 -# # it's asynchronous, so... +# # it's asynchronous, so... # #puts "alice holds #{alice.size} workitem(s)" #puts "bob holds #{bob.size} workitem(s)" # #puts engine.process_status(fei) class My2ndDefinition < OpenWFE::ProcessDefinition - sequence do - at :state => "redaction" - alice - at :state => "correction" - bob - alice - at :state => "approval" - charly - end + sequence do + at :state => "redaction" + alice + at :state => "correction" + bob + alice + at :state => "approval" + charly + end - process_definition :name => "at" do - set :var => "/state", :val => "${state}" - end + process_definition :name => "at" do + set :var => "/state", :val => "${state}" + end end #fei = engine.launch My2ndDefinition # #sleep 0.050 # #puts "state : " + engine.lookup_variable( -# 'state', fei.workflow_instance_id) +# 'state', fei.workflow_instance_id) class My3rdDefinition < OpenWFE::ProcessDefinition - sequence do - alice :tag => "redaction" - sequence :tag => "correction" do - bob - alice - end - charly :tag => "approval" + sequence do + alice :tag => "redaction" + sequence :tag => "correction" do + bob + alice end + charly :tag => "approval" + end end fei = engine.launch My3rdDefinition sleep 0.050 puts "state : " + engine.process_status( - fei.workflow_instance_id).tags.inspect + fei.workflow_instance_id).tags.inspect