11-11-2014 10:41 PM
<definitions … …>
<message id="correlation" name="Correlation"></message>
<process id="myProcessCorrelation" name="My process Correlation" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<scriptTask id="scripttask1" name="Print before" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script>println "Before"</script>
</scriptTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="scripttask1"></sequenceFlow>
<intermediateCatchEvent id="messageintermediatecatchevent1" name="MessageCatchEvent">
<messageEventDefinition messageRef="correlation"/>
</intermediateCatchEvent>
<sequenceFlow id="flow2" sourceRef="scripttask1" targetRef="messageintermediatecatchevent1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="messageintermediatecatchevent1" targetRef="scripttask2"></sequenceFlow>
<scriptTask id="scripttask2" name="Print After" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script>println "After"</script>
</scriptTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow4" sourceRef="scripttask2" targetRef="endevent1"></sequenceFlow>
</process>
</definitions>
RuntimeService runtimeService = activitiRule.getRuntimeService();
Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put("name", "Activiti");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcessCorrelation", variableMap);
Execution execution = runtimeService.createExecutionQuery()
.messageEventSubscriptionName("Correlation")
.variableValueEquals("name", "Activiti")
.singleResult();
runtimeService.messageEventReceived("Correlation", execution.getId()); // <– execution is null, why??!?!?!?
11-19-2014 05:21 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.