To be able to address multiple start events in the process, they are modeled as message start events.
As you see, there are reasons for different GUI depending on the start event. The remaining process can be the same.
How can I retrieve the form key from the start event?
First I tried to set up a parse listener for start events and check, whether there is a form key. If it is defined I could present the GUI. Unfortunately I could not find any entries in the API to retrieve the formKey. I found it on the XML elements. In the next step I looked through the code of the parser and recognized, that the parser does only parse the formKey for the user task and leaves my alone for the start event (hope that I'm wrong).
I asked Daniel how to retrieve the formKey. I said, I could use the method org.camunda.bpm.engine.FormService.getStartFormKey(String processDefinitionId). This seems to work only for ordinary start events. Since my problem case requires multiple start events, I use message based start events.
Please provide me some information how I can retrieve the form key for a message based start event.
BpmnModelInstance bpmnModelInstance = repositoryService.getBpmnModelInstance(processDefinitionId);
Collection<StartEvent> startEvents = bpmnModelInstance.getModelElementsByType(StartEvent.class);StartEvent startEvent = startEvents.iterator().next();String formKey = startEvent.getCamundaFormKey();