The Event sub process is available in the process level pallete and can be used while authoring a process/linked process.
The main use of the event sub process is to handle events ( message, time based, error events) that can occur in the process level.
The main advantage of using the event sub process is
- build effective process flow without complecating the actual process flow and let the event sub process handle the event processing load
- have a parallel mechanism to react to events
- decouple the process logic with event handling logic
- ease of implementing business use cases
Some of the main use cases of event sub processes are -
- listening for events while a process flow is in flight to either update the variables, notify the process flow to change the flow order due to the event, update third party system in a de coupled manner
- executing a logic after a certain point in time
- capture error events and have a generic error handling logic that is de coupled from the flow
The message based event sub process can be used as interrupting or non interrupting based on a regular UCA implementation
Note - the token on the message start event inside a event sub process is always active and a new one keeps replacing the one which was fired due a receving a message. the token is alive on the start message event till the lifecycle of the process instance
so in effect this acts as a perpertual event listener that does not need any kind of loop back to the start of the event sub process once the logic for the event sub process is completed.
this is one of the biggest advantage of the event sub process rather that simulating the effect in the main process flow.
We can also use a timer based start event in the event sub process, this fires only once on the set duration on timer after the process instance is created.
the error start event in the event sub process can catch any errors thrown/geenrated on the process level and the error event is always interrupting in nature.