Variables in subprocess discarded when boundary event caught

241 views
Skip to first unread message

galen...@gmail.com

unread,
Feb 12, 2014, 8:07:26 PM2/12/14
to camunda-...@googlegroups.com
Hi,

I'm not sure if I understand what the desired behavior is, but:

If I have a process that gets called by a callActivity, and I have some variables being copied out, they seem to not get copied if a boundary event occurs.


<bpmn2:callActivity id="CallActivity_2" name="call other process" calledElement="otherProcess">
<bpmn2:extensionElements>
<camunda:out source="ServiceTask_7_success" target="ServiceTask_7_success"/>
<camunda:out source="ServiceTask_8_success" target="ServiceTask_8_success"/>
<camunda:out source="ServiceTask_9_success" target="ServiceTask_9_success"/>
</bpmn2:extensionElements>
</bpmn2:callActivity>

<bpmn2:boundaryEvent id="BoundaryEvent_1" name="" attachedToRef="CallActivity_2">
<bpmn2:errorEventDefinition id="_ErrorEventDefinition_2" errorRef="Error_1"/>
</bpmn2:boundaryEvent>


So in this case I have several service tasks that get run inside of the "otherProcess" process. Halfway through "otherProcess" (after some variables have been set, for example "ServiceTask_7_success") a BpmnError is thrown. This causes the boundary event on the CallActivity to be called. However, in the parent process the "ServiceTask_7_success" variable doesn't get copied out to the parent process.

Should it get copied out, even if the boundary even occurs?

Thanks,
Galen


Daniel Meyer

unread,
Feb 14, 2014, 3:07:14 AM2/14/14
to camunda-...@googlegroups.com, galen...@gmail.com
Hi Galen,

What you describe is the expected behavior (or at least the behavior I would expect :) ). I had a quick look through the BPMN Spec and I think that this behavior is not fully specified. I'll ask or BPMN spec author Falko Menge whether he has more insight...

Cheers,
Daniel Meyer

galen...@gmail.com

unread,
Feb 14, 2014, 11:28:35 AM2/14/14
to camunda-...@googlegroups.com, galen...@gmail.com
Hi Daniel,

Thanks. It makes sense to me, since there is only an "interrupting" boundary error event. Perhaps if there such a thing as a non-interrupting error boundary event, then maybe some of the "camunda:out" elements would be able to be processed. :)

Thanks,
Galen

Falko Menge

unread,
Feb 14, 2014, 1:15:12 PM2/14/14
to camunda-...@googlegroups.com, galen...@gmail.com
Hi Galen, Hi Daniel,

the BPMN 2.0.1 Spec says on page 429 (PDF 459):

"An Activity’s execution is interrupted if an interrupting Event is raised (such as an error) or if an interrupting Event Sub-Process is initiated,[...]  The data context of the Activity is preserved in case an interrupting Event Sub-Process is invoked. The data context is released after the Event Sub-Process reaches a final state."

So will need to use an Event Sub-Process inside the called process to get access to the data.

Alternatively, the Error could transport the process variables as a payload. But that would be a feature request for camunda BPM.

Cheers,
Falko

Daniel Meyer

unread,
Feb 17, 2014, 7:23:21 AM2/17/14
to camunda-...@googlegroups.com, galen...@gmail.com
Hi Falko,

thanks a lot for your input! It is good to have one of the BPMN Spec Guys on the team!

Cheers,
Daniel Meyer
Reply all
Reply to author
Forward
0 new messages