Hi,
I have created following process model to test out subprocess:
But when I try to start a process instance for this, it says cannot start process with multiple start events. Funny thing is if I remove the ‘Start’ in the subprocess then it errors that ‘ActivitiException: No initial activity found for subprocess’.
Looking at the implementation, I see following is the part where the problem exists
@Override
public Map<String, List<ExtensionElement>> getStartExtensionElements(String actProcessDefinitionId) {
BpmnModel bpmnModel = repositoryService.getBpmnModel(actProcessDefinitionId);
List<StartEvent> startEvents = bpmnModel.getMainProcess().findFlowElementsOfType(StartEvent.class);
if (startEvents.size() != 1) {
throw new BpmException("Cannot process process with multiple start events");
}
StartEvent startEvent = startEvents.get(0);
return startEvent.getExtensionElements();
}
Calling findFlowElementsOfType without second param fetches start event from subprocess as well. Instead findFlowElementsOfType should be called with second argument as false
Today I tested and its a UI bug as I am able to start the same process instance using ProcessRuntimeManager.
Thanks