cancel
Showing results for 
Search instead for 
Did you mean: 

CallActivity vs. SubProcess

dguggi
Champ in-the-making
Champ in-the-making
hello,

I have a process with an (embedded) SubProcess like this:

[attachment=2]SubProcessTest.png[/attachment]

If the parent process reaches the compensation-throw-event, the cancelSomething (compensation) service-task (of the sub-process) is executed as expected.

However, when I try to achieve the same with a CallActivity like this

parent-prozess:
[attachment=1]CallActivityWithCompensatingSubProcessTest.png[/attachment]
sub-process:
[attachment=0]SimpleProcessWithServiceTaskAndCompensation.png[/attachment]

in this case the "cancelSomething" (compensation) service-task is never called.

So, is this the expected behaviour? Or is there any alternative to achieve the desired functionality with CallActivities?

ty,
daniel
3 REPLIES 3

workflowuser2
Champ in-the-making
Champ in-the-making
well, I am no expert but in my evaluation I found that compensating transaction works within subprocess scope only.

<transaction id="myTransaction" >
<subProcess id="subProcess">
        …

</subprocess>
</transaction>


Could you try creating a subprocess and embedding call-activiti within it?

pdt

dguggi
Champ in-the-making
Champ in-the-making
hi,

yes I tried to put the callactivity inside a (transactional) subprocess but compensation does not work for the process called by callactiviy.

however this seems to be the expected behaviour (according to the bpm-specs chapter: 10.7 Compensation) - can someone confirm this?

davidnguyen
Champ in-the-making
Champ in-the-making
Hello,

I have the same problem here: a main process (compensateProcess.txt) has to be compensated after a callActivity (someProcess.txt) has returned. How can I trigger the compensation on the called activity ?

I start the main process using the REST api:
<code>
{"processDefinitionKey":"compensateProcess", "variables":[{"name": "successful", "value": false}]}
</code>

I get the following output:
<code>
First task
second task
hello
subprocess
compensate subprocess
compensate second task
compensate first task
</code>

the called activity outputs the "hello" line and should be compensated at some point. Note that the compensation works just fine with an embedded subprocess.