The processEvent method
is the main event
consumption method. It handles the passing of events and triggered
operations from the framework to the user-defined statechart, which
then consumes them.
This
method is called by
the takeEvent and takeTrigger methods.
You can override processEvent to specialize
different event consumption behaviors:
- Create
a reactive class that consumes events without
a statechart.
- Add functionality to a class's
event consumption.
Signaturevirtual TakeEventStatus processEvent (OMEvent* ev);
Parametersev
Specifies the event to be consumed
ReturnsThe
method returns one of the values defined in the TakeEventStatus enumerated
type. You can use these values to determine whether and how to continue
with event processing on the reactive object.
The
possible values are as follows:
- OMTakeEventCompletedEventNotConsumed
(0) -
The event was completed, but not consumed.
- OMTakeEventCompleted
(1) - The
event was completed.
- OMTakeEventInDtor
(2) - The event
was not completed because the OMReactive instance
is in destruction.
- OMTakeEventReachTerminate
(3) -
The event was not completed because the statechart has reached a termination
connector and the reactive object is destroyed.
Note: The processEvent method includes the ability
to handle events and triggered operations that were not consumed.
This is conceptually a callback method that you must override to
define the actual handling of unconsumed events. To support this modification,
the method signature was changed.