Hi there,
has the signalEvant handling been changed in flowable 6?
the blow snippet works in activiti 5.22.0 but produces an error in flowable 6.0.1
org.flowable.engine.common.api.FlowableException: Execution '6' has not subscribed to a signal event with name 'signal'.
public class SignalTest {
@Test
public void testSignal() {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
repositoryService.createDeployment().name("simple").addClasspathResource("processes/simple.bpmn").deploy();
runtimeService.startProcessInstanceByKey("eventProcess");
Task t = taskService.createTaskQuery().taskDefinitionKey("userTask").singleResult();
runtimeService.signalEventReceived("signal", t.getExecutionId());
assertTrue(runtimeService.createProcessInstanceQuery().list().size() == 0);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:flowable="http://flowable.org/bpmn" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="Examples">
<signal id="signal" name="signal"></signal>
<process id="eventProcess" isExecutable="true">
<startEvent id="start"></startEvent>
<userTask id="userTask" name="User Task"></userTask>
<boundaryEvent id="boundaryEvent" name="Boundary event" attachedToRef="userTask" cancelActivity="true">
<signalEventDefinition signalRef="signal"></signalEventDefinition>
</boundaryEvent>
<sequenceFlow id="flow4" sourceRef="userTask" targetRef="end"></sequenceFlow>
<endEvent id="end"></endEvent>
<scriptTask id="scripttask1" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script><![CDATA[out:println "Signal Received";]]></script>
</scriptTask>
<sequenceFlow id="flow7" sourceRef="boundaryEvent" targetRef="scripttask1"></sequenceFlow>
<sequenceFlow id="flow8" sourceRef="scripttask1" targetRef="end"></sequenceFlow>
<sequenceFlow id="flow9" sourceRef="start" targetRef="userTask"></sequenceFlow>
</process>
</definitions>