Skip to content

Instantly share code, notes, and snippets.

Created January 7, 2011 12:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/769406 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'ruote'
engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new))
class MyParticipant
include Ruote::LocalParticipant
def consume(workitem)
p [ workitem.participant_name, :tags, workitem.tags ]
workitem.fields['qa_ok'] = true
reply_to_engine(workitem)
end
end
engine.register do
catchall MyParticipant
end
#engine.noisy = true
pdef = Ruote.define do
cursor do
sequence :tag => 'production-stage' do
production
concurrence :tag => 'qa_stage' do
qa1
qa2
end
end
rewind :unless => '${qa_ok}'
sequence :tag => 'delivery-stage' do
packaging
delivery
end
end
end
wfid = engine.launch(pdef)
engine.wait_for(wfid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment