Dispatching an event

The method OMThread::execute is responsible for the event loop.

About this task

The following sequence diagram shows a dispatched event.

This sequence diagram shows the main sequence of events that are done inside this method.

The event loop is as follows:

Procedure

  1. execute calls the get method to get the first event from the event queue.
  2. If the event is not a NULL event, execute calls the getDestination method to determine the OMReactive destination for the event.
  3. execute calls the takeEvent method to request that the reactive object process the event. takeEvent calls the processEvent method, which does the following:
    1. 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 TRUE

      Calls getlId to get the event ID

      Passes the value of lId to rootState_dispatchEvent to dispatch that event

    2. 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.
    3. processEvent calls undoBusy to reset the sm_busy flag to FALSE.
  4. execute calls the isDeleteAfterConsume method to determine whether the event is deleted. If the Attributes attribute is TRUE, execute calls the Delete method to delete the event.

Feedback