All,
Actually I don't see what I was doing wrong. I can't even seem to get
my workitem to move from the beginning of the workflow.
I pull the workitem using workitem = @participants.by_wfid(wfid)[0] with
the correct wfid value.
Then I call:
@participants.consume(workitem)
puts "Workitem: #{workitem.fields.inspect}\nDestined for:
#{workitem.participant_name}\[email protected](wfid).inspect}"
@participants.reply(workitem)
puts "Workitem: #{workitem.fields.inspect}\nDestined for:
#{workitem.participant_name}\[email protected](wfid).inspect}"
Every time I print out the debug information, I get:
Workitem: {"from"=>"koached", "to"=>"[email protected]",
"dispatched_at"=>"2010-05-26 20:39:50.399334 UTC",
"params"=>{"koached"=>nil}, "message"=>"Welcome to Koached,
[email protected]!!!"}
Destined for: koached
== Ruote::ProcessStatus ==
expressions : 3
0!!20100526-bobemusazo : #<Ruote::Exp::SequenceExpression:0x104a4c798>
0_0!!20100526-bobemusazo : #<Ruote::Exp::CursorExpression:0x104a4b708>
0_0_0!!20100526-bobemusazo :
#<Ruote::Exp::ParticipantExpression:0x104a4a6c8>
errors : 0
<message from='[email protected]/gmail.D374D9E2'
to='[email protected]/0F4FA688' id='9165DE35F36B7B8A_0' type='chat'
iconset='classic' xmlns='jabber:client'> ... </>
How do I get my workitem to move?
Thanks,
Wes
On 5/26/10 3:11 PM, Wes Gamble wrote:
All,
I see what I was doing wrong. I didn't understand that calling
Participant#by_xxxx actually removed the workitem from the context and
that I needed to grab it. Now that I'm doing that, I have other,
simpler problems that have nothing to do with ruote.
FWIW, a more explicit StorageParticipant example might be appropriate.
Wes
On 5/26/10 2:39 PM, Wes Gamble wrote:
All,
Here's the definition for my first workflow:
@pdef = Ruote.process_definition :name => 'test_workflow' do
cursor do
participant 'koached'
participant 'rules_engine'
participant '${to}'
'${message}' == 'STOP' ? _break : rewind
end
end
and the definition of my participants:
#Register the rules_engine
@engine.register_participant 'rules_engine',
Rufus::Decision::Participant,
:table => %{
in:message,out:message
,"Here's a random number between 1 and 15: #{rand(15)}"
}
#Register the participants as participants who store their
workitems in the same storage as the engine
@participants = @engine.register_participant '.+',
Ruote::StorageParticipant
After launch, I print out the workitem, it's participant (destined
for), and the process status of my workflow instance, which are as
follows:
Workitem: {"from"=>"koached", "to"=>"[email protected]",
"dispatched_at"=>"2010-05-26 19:32:38.461265 UTC",
"params"=>{"koached"=>nil}, "message"=>"Welcome to Koached,
[email protected]!!!"}
Destined for: koached
== Ruote::ProcessStatus ==
expressions : 3
0!!20100526-bijejejada :
#<Ruote::Exp::SequenceExpression:0x104eb9fb0>
0_0!!20100526-bijejejada :
#<Ruote::Exp::CursorExpression:0x104eb6658>
0_0_0!!20100526-bijejejada :
#<Ruote::Exp::ParticipantExpression:0x104eb0de8>
errors : 0
I was under the impression that when I launched my workflow that the
first participant would immediately get the workitem, but that
doesn't seem to be the case. Do I need to call "consume" or "fetch"
to get the workitem to belong to 'koached'?
Thanks,
Wes
--
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
--
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
--
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