Create a gist now

Instantly share code, notes, and snippets.

anonymous /testing.rb
Created Jan 7, 2011

What would you like to do?
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