Hey John,
I think I may know why I am running into problems. Thanks for the test
case, that was very helpful.
Here is what I am doing:
My process definition
class MyProcess < OpenWFE::ProcessDefinition
sequence do
participant :convert, {:raise => 'True'}
end
end
The convert participant is a custom participant that sends the data
over Ice into a python backend. The python code raises an exception if
'raise' is 'True', and that exception is passed back to the engine.
I am using the participant paramaters because they give me some stuff
for free, like getting cleaned up after the participant runs.
What I think is happening is that the parameters cannot be overridden?
Is that correct?
When I launch the process here is a dump of the workitem:
started process '20080418-hopujapo'
#<OpenWFE::InFlowWorkItem:0xb77ed0d0
@attributes={"params"=>{"raise"=>"True"}},
@dispatch_time=Thu Apr 17 17:10:39 -0700 2008,
@flow_expression_id=
#<OpenWFE::FlowExpressionId:0xb7b4c438
@engine_id="engine",
@expression_id="0.0.0",
@expression_name="participant",
@owfe_version="0.9.17",
@workflow_definition_name="Scan",
@workflow_definition_revision="0",
@workflow_definition_url="field:__definition",
@workflow_instance_id="20080418-hopujapo">,
@last_modified=nil,
@participant_name="convert">
I get the error state and do the following to change it from the irb
console inside of the engine.
>> my_wfid = "20080418-hopujapo"
>> error = self.get_error_journal.get_error_log(my_wfid)[0]
>> puts error
-- OpenWFE::ProcessError --
date : Thu Apr 17 17:10:42 -0700 2008
fei : (fei 0.9.17 engine field:__definition Scan 0
20080418-hopujapo participant 0.0.0)
message : do_apply
workitem : ...
error_class : Actions::ExecuteError
stacktrace : exception : actions::ExecuteError
>> error.workitem.params['raise'] = "False"
>> error.workitem.test_item = "New Item"
>>puts error.workitem
OpenWFE::InFlowWorkItem :
- flow_expression_id : (fei 0.9.17 engine field:__definition Scan 0
20080418-hopujapo participant 0.0.0)
- participant_name : convert
- last_modified :
- dispatch_time : Thu Apr 17 17:10:39 -0700 2008
- attributes :
{
"params" => {"raise"=>"False"},
"test_item" => "New Item",
}
As you can see, the param "raise" was set to False adn the "test_item"
key was also set as I expected.
Here is what the replay prints out as the workitem when I replay the
error ( I am dumping the workitem as part of the consume method):
>> self.replay_at_error error
#<Thread:0xb77fcdb4 run>
#<OpenWFE::InFlowWorkItem:0xb7936aa4
@attributes={"test_item"=>"New Item", "params"=>{"raise"=>"True"}},
@dispatch_time=Thu Apr 17 17:16:27 -0700 2008,
@flow_expression_id=
#<OpenWFE::FlowExpressionId:0xb7b4c438
@engine_id="engine",
@expression_id="0.0.0",
@expression_name="participant",
@owfe_version="0.9.17",
@workflow_definition_name="Scan",
@workflow_definition_revision="0",
@workflow_definition_url="field:__definition",
@workflow_instance_id="20080418-hopujapo">,
@last_modified=nil,
@participant_name="convert">
So the test_item attribute is still there, but the value of the
'raise' parameter was changed back. I am guessing the params are
handled specially somehow? If there is no way around this I can
probably work around it by using a custom field to store my params
instead of the params attribute?
If any of that doesn't make sense let me know. Sorry for verbosity.
Let me know your thoughts. Thanks a bunch for your help.
-Nick Petrella
On Apr 17, 4:11 pm, "John Mettraux" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 18, 2008 at 5:24 AM, Nick Petrella <[EMAIL PROTECTED]> wrote:
>
> > I tried to edit the workitem that was part of the error object that I
> > got through the engine, but then when I ran the replay_from_error
> > method, the workitem it used was the original.
>
> > What is the best way to modify the values before replaying the step?
>
> Hi Nick,
>
> I've tried to reproduce your problem and added this test :
>
> http://github.com/jmettraux/ruote/commit/0a5991a52297f73ea4d63e9e9bd8...
>
> it runs successfully for me. Is it similar to what you're trying to achieve ?
>
> Cheers,
>
> --
> John Mettraux -///-http://jmettraux.openwfe.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---