Skip to content

Instantly share code, notes, and snippets.

Created January 7, 2011 11:18
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/769362 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
production
concurrence do
qa1
qa2
end
rewind :unless => '${qa_ok}'
packaging
end
end
wfid = engine.launch(pdef)
engine.wait_for(:production)
p engine.process(wfid)
# =>
# == Ruote::ProcessStatus ==
# expressions : 3
# 0!69176db85a0651e7a8d8a16426bd93df!20110107-betesuguto : define {}
# 0_0!be7ac163b2c6ba47d6d4b24bbb83fd8c!20110107-betesuguto : cursor {}
# 0_0_0!3b19bdf68a953597969bac507229bcf1!20110107-betesuguto : participant {"ref"=>"production"}
# schedules : 0
# stored workitems : 1
# variables : {}
# all_variables : {"0!69176db85a0651e7a8d8a16426bd93df!20110107-betesuguto"=>{}}
# errors : 0
p engine.process(wfid).position
# =>
# [
# [ "0_0_0!3b19bdf68a953597969bac507229bcf1!20110107-betesuguto",
# "production",
# {} ] ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment