Question

I have a main process “compensateProcess” that is calling a activity "someProcess":

compensateProcess

Where someProcess is:

someProcess

If I start the main process from the REST api with the successful varible set to false, the compensation event is thrown.

{"processDefinitionKey":"compensateProcess", "variables":[{"name": "successful", "value": false}]}

and I get the following output:

First task
second task
hello
compensate second task
compensate first task

So the “compensate hello” task is not executed. This may be normal as there is no boundary event linked to the call activity. Is it possible to forward the compensation event to the called activity? The goal is to avoid having to reimplement the “compensate hello” task, which would lead to duplicate code.

Note that if I replace the callActivity with an embedded subprocess, the compensation is executed as expected.

Was it helpful?

Solution

If you really need Compensate Hello to be triggered then you should duplicate it in your main process, too.

From the Activiti userguide(5.15 currently):

Compensation is not propagated to sub process instances spawned by call activities.

You can check it out at Userguide, please look at Current limitations section, a bit below.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top