Skip to content

Instantly share code, notes, and snippets.

Created January 7, 2011 11:28
  • 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/769371 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'ruote'
engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new))
engine.register do
catchall Ruote::StorageParticipant
end
#engine.noisy = true
pdef = Ruote.define do
cursor do
sequence :tag => 'production-stage' do
production
concurrence 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(:production)
p engine.process(wfid).tags
# =>
# { "production-stage" => {
# "engine_id" => "engine",
# "wfid" => "20110107-hopakeze",
# "subid" => "0f62bbb3a0a19411aaef1524ebde657c",
# "expid" => "0_0_0" } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment