Extending : Processor editor extension : Extending runtime processor : How a flow processor works
  
How a flow processor works
This section describes how a flow processor handles a flow through different states according to the definitions until the processor reaches the final state.
1 The externalizer of a processor instantiates an instance of the processor from the external definition of the processor. The behavior of the externalizer of the processor to create an object is the same as other UDTT externalizers.
The externalizer searches for the name of the flow processor.
The externalizer obtains the class of the flow processor from the configuration file.
The externalizer sends the initializeFrom(Tag aTag) method to the flow processor instance to initialize it according to the definitions embedded in the tag.
2 When the toolkit initializes an instance of a flow processor, it caches in memory the possible states along with their actions, transitions, and data without actually instantiating them. Objects from these definitions are only created at runtime when they are required during the life cycle of the process.
3 The processor externalizer implements an object cache to improve performance.
4 The toolkit executes the processor instance. The process handled by the flow processor starts in its initial state and follows a defined path until it enters one of its final states.
5 When the processor enters a state, the state registers with notifiers as being interested in any events specified in the state's transitions. The notifiers can be any notifier available in the context or any of the actions being executed.
6 The processor synchronously executes the state's entry actions in the order in which they appear in the external definition of the state. If an entry action causes an event to fire and the event belongs to a transition defined for the state, the processor places the event in an internal queue to synchronize the actual handling of events.
7 After executing the entry actions, the flow processor checks the event queue and executes any events it finds there. If there are no events in the queue, the processor waits in the state for a triggering event. The use of the event queue to synchronize events does not prevent actions and guard conditions from having the opportunity to handle an event fired by a notifier while the processor is executing entry actions. The processor provides the event to them without losing the original event data.
To execute an event, the flow processor executes the actions for the event's transition after evaluating the guard conditions for each action. Depending on the results of evaluating the guard conditions and applying flow modifiers, the flow processor performs the exit actions defined for the state and then enters the defined target state to advance the process.
Go up to
Extending runtime processor