Interupt signal on parallell subprocesses


#1

I have used this pattern in Activiti before but I can’t make it work in Camunda.
Scenario: I have two parallell subprocesses and when the first one ends it shall automatically end the other one. If the second one ends nothing else happens.

Result:
java.lang.AssertionError: Expecting actual ProcessInstance {id=‘4’, processDefinitionId=‘invantaKomplettering:1:3’, businessKey=‘null’} to be ended, but it is not!.

Both tasks are ended but there is still two executions running, but why?

Simplified diagram:

An Junit test:
public class InvantaKompletterTest {

private static final String MAIN_PROCESS = “invantaKomplettering”;

@Rule
public ProcessEngineRule processEngineRule = new ProcessEngineRule();

@Test
@Deployment(resources = {“diagrams/InvantaKomplettering.bpmn”})
public void testInkommenKomplettering() {
Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put(“businessIdType”, “ARENDE_ID”);
variableMap.put(“businessId”, “0”);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(MAIN_PROCESS, variableMap);
assertThat(processInstance).isStarted();

final TaskService taskService = processEngineRule.getTaskService();
List<Task> tasks = taskService.createTaskQuery().list();
assertEquals(2, tasks.size());

Task task = taskService.createTaskQuery().taskDefinitionKey(“mainTask”).singleResult();
taskService.complete(task.getId());

tasks = taskService.createTaskQuery().list();
assertEquals(0, tasks.size());

assertThat(processInstance).isEnded();
}
}


#2

Can you upload your bpmn model?


#3

Well, I continued to do some more testing, and to revert to this scenario I deleted the throw and catch elements and then added them again, and suddenly my Junit-test says ok :open_mouth:

So it seems that this actually works, case closed.