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
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