You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ProcessInstanceHelper contains an invalid fix to start instances by messages since 7.2.0:
` public ProcessInstance createAndStartProcessInstanceByMessage(...) {
...
for (FlowElement flowElement : process.getFlowElements()) {
if (flowElement instanceof StartEvent) {
StartEvent startEvent = (StartEvent) flowElement;
if (CollectionUtil.isNotEmpty(startEvent.getEventDefinitions()) && startEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) {
MessageEventDefinition messageEventDefinition = (MessageEventDefinition) startEvent.getEventDefinitions().get(0);
String messageRef = messageEventDefinition.getMessageRef();
if (messageRef.equals(messageName)) {
initialFlowElement = flowElement;
break;
} // FIXME: We should not need to reset eventDefinition messageRef to message name
else if (bpmnModel.containsMessageId(messageRef)) {
Message message = bpmnModel.getMessage(messageRef);
messageEventDefinition.setMessageRef(message.getName());
initialFlowElement = flowElement;
break;
}`
The 'FIXME' part uses always the first found 'StartEvent', if the given 'messageName' contains to process model definition. But if the process definition contains two or more messages they will be ignored and the first one is chosen.
The ProcessInstanceHelper contains an invalid fix to start instances by messages since 7.2.0:
` public ProcessInstance createAndStartProcessInstanceByMessage(...) {
...
for (FlowElement flowElement : process.getFlowElements()) {
if (flowElement instanceof StartEvent) {
StartEvent startEvent = (StartEvent) flowElement;
if (CollectionUtil.isNotEmpty(startEvent.getEventDefinitions()) && startEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) {
The 'FIXME' part uses always the first found 'StartEvent', if the given 'messageName' contains to process model definition. But if the process definition contains two or more messages they will be ignored and the first one is chosen.
<definitions ...> <message id="FirstMessage" name="FirstMessage"/> <message id="SecondMessage" name="SecondMessage"/> <process id="myProcess" name="myProcess"> <startEvent id="FirstStartEvent" name="FirstStartEvent.label"> <messageEventDefinition messageRef="FirstMessage"/> </startEvent> <startEvent id="SecondStartEvent" name="SecondStartEvent.label"> <messageEventDefinition messageRef="SecondMessage"/> </startEvent> ... </process> </definitions>
But if we call
getRuntimeService().startProcessInstanceByMessage("SecondMessage", "myProcess")
the wrong 'FirstStartEvent' is chosen and executed.The text was updated successfully, but these errors were encountered: