Detect triggered start event


I have a workflow with multiple message start events, and they work without any problem. Now I want to detect which one triggered the workflow to start. I need it for the following decisions.
Now I have used a script task after each of them, set a variable, and then use it in the workflow. I want to know whether there is any better solution to detect which message start event triggered the process?


@dooghi You can add execution listener to all the start events and set the type of start event or instance id. So that you can refer that in following tasks.

Here’s a sample code for reference:

public class EventTypeIdentifierListener implements ExecutionListener {

    public void notify(DelegateExecution execution) throws Exception {
            //<event_type> can be any type of start events
1 Like