A dispatched
triggered operation uses the takeTrigger method
to consume the event.
Before you begin
The following
sequence diagram shows a dispatched triggered
operation (synchronous event).
About this task
To dispatch triggered operations:
Procedure
- The takeTrigger method
is called for the triggered operation.
- takeTrigger calls
the processEvent method
to consume the event.
- processEvent does
the following:
- It calls isBusy to
determine whether
the object is already consuming an event. If the object is not busy, processEvent does
the following: Sets the sm_busy flag to TRUECalls getlId to
get the event ID
- processEvent calls shouldCompleteRun to
see if there are any null transitions to take after the event has
been consumed. If there are null transitions to be taken, the method
calls runToCompletion to take them.
- processEvent calls undoBusy to
reset the sm_busy flag to FALSE.
- takeTrigger calls
the shouldTerminate and setShouldDelete methods.
If (shouldTerminate() && shouldDelete()) is
1 (or TRUE), takeTrigger deletes
the event.