Hi John and everyone
It's been a few days that I 've been discovering ruote, and thanks to
John's tutorial, I now have a nice and obedient workflow engine that
does what I wan't it to.
The "problem" is that I'd like it to do more work for me, and so my
script will keep growing and growing.
I've read things about the differents participants, subprocesses,
remote processes, but I still have this simple and dumb (it's ok, I
can totally endure face palms) question to ask...
For the sake of the example, say we have a (very simple) workflow.rb
script like this one:
---8<---
require 'rubygems'
require 'openwfe/engine'
# instantiate the workflow engine
engine = OpenWFE::Engine.new(:definition_in_launchitem_allowed)
# process definition
my_process = OpenWFE.process_definition :name => "my_process" do
sequence do
alpha
bravo
end
end
## participants
engine.register_participant :alpha do |workitem|
puts workitem.for_alpha
end
engine.register_participant :bravo do
puts "go for bravo"
puts "bravo done"
end
# launch the process
launchitem = OpenWFE::LaunchItem.new(my_process)
launchitem.for_alpha = "dear alpha, read this carefully"
# flow expression id
fei = engine.launch(li)
engine.wait_for fei
--->8---
Although it's obviously not necessary for a short script like this,
what options do I have if I want to :
- move the process definition away from this file ?
- move the (block)participants away from this file and still be able
to access the "workitem" fields ?
To keep it simple, what's the nice way to split workflow.rb into
{ workflow_engine.rb, processes.rb, my_process.rb }
Again, this question may be dumb, but I'm lacking workflow engine/
ruote (and ruby, by the way, though I'm not sure it's relevant)
experience and as far as I've read, I've seen no example of a workflow
divided in several files, with the engine on one side and processes or
participant definition in different places.
Thanks for your attention and please don't hurt your foreheads ;)
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---