I am trying to model an event-based gateway that waits for several messages, and optionally for a timer. Before using this in a real model I tried it in a unit test, and it seems in the camunda engine the condition is completely ignored. Now I'm wondering if this is supposed to be supported by bpmn, if not if there is an easy alternative way to model this.
The code for the unit test, based on the camunda-engine-unit-test project is as following:
Map<String, Object> variables = singletonMap("isTimerActive", (Object) false);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("testProcess", variables);
assertFalse("Process instance should not be ended", pi.isEnded());
String id = pi.getProcessInstanceId();
Job timer = managementService.createJobQuery().processInstanceId(id).timers().active().singleResult();
assertNull(timer);
This is not allowed.
BPMN 2.0 Specification Section 10.5.6, page 297
edit: source: http://www.omg.org/spec/BPMN/2.0/PDF