Hi!
I've got some problems when using the StorageParticipant.
This is what I've done:
Register a participant:
require 'ruote/part/storage_participant'
Ruote.engine.register_participant(/workflow_step_.*/,
Ruote::StorageParticipant)
Process definition (in XML):
process_definition = <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<process-definition name='test' version='0.1'>
<cursor>
<jump to="outer_workflow_step_leer" />
<concurrence count="1" tag="outer_workflow_step_leer">
<participant ref="workflow_step_leer" />
</concurrence>
<jump to="outer_workflow_step_dreh-frei" if="${f:next_state} ==
workflow_step_dreh-frei" />
<jump to="outer_workflow_step_abgebrochen" if="${f:next_state} ==
workflow_step_abgebrochen" />
<jump to="outer_workflow_step_wiedervorlage" if="${f:next_state} ==
workflow_step_wiedervorlage" />
<concurrence count="1" tag="outer_workflow_step_dreh-frei">
<participant ref="workflow_step_dreh-frei" />
</concurrence>
<jump to="outer_workflow_step_leer" if="${f:next_state} ==
workflow_step_leer" />
<jump to="outer_workflow_step_gedreht" if="${f:next_state} ==
workflow_step_gedreht" />
<concurrence count="1" tag="outer_workflow_step_gedreht">
<participant ref="workflow_step_gedreht" />
</concurrence>
<jump to="outer_workflow_step_dreh-frei" if="${f:next_state} ==
workflow_step_dreh-frei" />
<jump to="outer_workflow_step_im-schnitt" if="${f:next_state} ==
workflow_step_im-schnitt" />
<concurrence count="1" tag="outer_workflow_step_im-schnitt">
<participant ref="workflow_step_im-schnitt" />
</concurrence>
<jump to="outer_workflow_step_gedreht" if="${f:next_state} ==
workflow_step_gedreht" />
<jump to="outer_workflow_step_geschnitten" if="${f:next_state} ==
workflow_step_geschnitten" />
<concurrence count="1" tag="outer_workflow_step_geschnitten">
<participant ref="workflow_step_geschnitten" />
</concurrence>
<jump to="outer_workflow_step_im-schnitt" if="${f:next_state} ==
workflow_step_im-schnitt" />
<jump to="outer_workflow_step_wartet-auf-freigabe"
if="${f:next_state} == workflow_step_wartet-auf-freigabe" />
<concurrence count="1" tag="outer_workflow_step_wartet-auf-freigabe">
<participant ref="workflow_step_wartet-auf-freigabe" />
</concurrence>
<jump to="outer_workflow_step_geschnitten" if="${f:next_state} ==
workflow_step_geschnitten" />
<jump to="outer_workflow_step_freigegeben" if="${f:next_state} ==
workflow_step_freigegeben" />
<concurrence count="1" tag="outer_workflow_step_freigegeben">
<participant ref="workflow_step_freigegeben" />
</concurrence>
<concurrence count="1" tag="outer_workflow_step_abgebrochen">
<participant ref="workflow_step_abgebrochen" />
</concurrence>
<concurrence count="1" tag="outer_workflow_step_wiedervorlage">
<participant ref="workflow_step_wiedervorlage" />
</concurrence>
<jump to="outer_workflow_step_leer" if="${f:next_state} ==
workflow_step_leer" />
<jump to="outer_workflow_step_dreh-frei" if="${f:next_state} ==
workflow_step_dreh-frei" />
</cursor>
</process-definition>
EOT
(it's just an example and far from being sensible)
Launch the process:
wfid = Ruote.engine.launch process_definition
=> "20100126-bokatoguse"
Is there a workitem?
Ruote.storage_participant.by_wfid(wfid)
=> [#<Ruote::Workitem:0xb6835480 @h={"_rev"=>0, "put_at"=>"2010-01-26
13:33:56.350231 UTC", "wfid"=>"20100126-bokatoguse",
"participant_name"=>"workflow_step_leer",
"_id"=>"wi_0_0_1_0!!20100126-bokatoguse",
"fields"=>{"params"=>{"ref"=>"workflow_step_leer"}},
"type"=>"workitems", "fei"=>{"wfid"=>"20100126-bokatoguse",
"engine_id"=>"engine", "expid"=>"0_0_1_0"}}>]
Yes, indeed! Set fields['next_state'] and reply to the engine:
i = Ruote.storage_participant.by_wfid(wfid).first
i.fields['next_state'] = 'workflow_step_dreh-frei'
Ruote.storage_participant.reply(i)
There should be a new workitem in the storage participant now, let's check:
Ruote.storage_participant.by_wfid(wfid)
=> []
Oops.
The process is still present (never mind the changed wfid, tried with a
new process, same result):
p = Ruote.engine.process(wfid)
=> == Ruote::ProcessStatus ==
expressions : 4
0!!20100126-bipupobawa : #<Ruote::Exp::SequenceExpression:0xb67c1c88>
0_0!!20100126-bipupobawa : #<Ruote::Exp::CursorExpression:0xb67c1468>
0_0_5!!20100126-bipupobawa :
#<Ruote::Exp::ConcurrenceExpression:0xb67c02ac>
0_0_5_0!!20100126-bipupobawa :
#<Ruote::Exp::ParticipantExpression:0xb67bf0f0>
errors : 0
The process should be in the next participant:
p.expressions.last.h['participant_name']
=> "workflow_step_dreh-frei"
And it seems it is. But no workitem.
Having a look in the work dir:
$ ls -la \
work_development/workitems/wa/wi_0_0_5_0\!\!20100126-bipupobawa.json
-rw-r--r-- 1 tsc tsc 0 2010-01-26 15:08
work_development/workitems/wa/wi_0_0_5_0!!20100126-bipupobawa.json
The json file is empty. Is that correct?
If you need more information, drop me a line.
Thanks for your constant work & help,
Torsten
--
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