org.apache.commons.scxml
Interface SCXMLSemantics

All Known Implementing Classes:
SCXMLSemanticsImpl

public interface SCXMLSemantics

The purpose of this interface is to separate the interpretation algorithm from the SCXMLExecutor and therefore make it pluggable.

Semantics agnostic utility functions and common operators as defined in UML can be found in the SCXMLHelper or attached directly to the SCXML model elements. Some of the possible semantic interpretations are, for example:

Specific semantics can be created by subclassing org.apache.commons.scxml.semantics.SCXMLSemanticsImpl.


Method Summary
 void determineInitialStates(SCXML input, Set states, List entryList, ErrorReporter errRep, SCInstance scInstance)
          Determining the initial state(s) for this state machine.
 void enumerateReachableTransitions(SCXML stateMachine, Step step, ErrorReporter errRep)
          Enumerate all the reachable transitions.
 void executeActions(Step step, SCXML stateMachine, EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance)
          Executes all OnExit/Transition/OnEntry transitional actions.
 void filterTransitionsSet(Step step, EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance)
          Filter the transitions set, eliminate those whose guard conditions are not satisfied.
 void followTransitions(Step step, ErrorReporter errorReporter, SCInstance scInstance)
          Follow the candidate transitions for this execution Step, and update the lists of entered and exited states accordingly.
 void initiateInvokes(Step step, ErrorReporter errRep, SCInstance scInstance)
          Initiate any new invoked activities.
 SCXML normalizeStateMachine(SCXML input, ErrorReporter errRep)
          Optional post processing immediately following Digester.
 void processInvokes(TriggerEvent[] events, ErrorReporter errRep, SCInstance scInstance)
          Forward events to invoked activities, execute finalize handlers.
 void updateHistoryStates(Step step, ErrorReporter errRep, SCInstance scInstance)
          Go over the exit list and update history information for relevant states.
 

Method Detail

normalizeStateMachine

SCXML normalizeStateMachine(SCXML input,
                            ErrorReporter errRep)
Optional post processing immediately following Digester. May be used for removing pseudo-states etc.

Parameters:
input - SCXML state machine
errRep - ErrorReporter callback
Returns:
normalized SCXML state machine, pseudo states are removed, etc.

determineInitialStates

void determineInitialStates(SCXML input,
                            Set states,
                            List entryList,
                            ErrorReporter errRep,
                            SCInstance scInstance)
                            throws ModelException
Determining the initial state(s) for this state machine.

Parameters:
input - SCXML state machine
states - a set of States to populate
entryList - a list of States and Parallels to enter
errRep - ErrorReporter callback
scInstance - The state chart instance
Throws:
ModelException - in case there is a fatal SCXML object model problem.

executeActions

void executeActions(Step step,
                    SCXML stateMachine,
                    EventDispatcher evtDispatcher,
                    ErrorReporter errRep,
                    SCInstance scInstance)
                    throws ModelException
Executes all OnExit/Transition/OnEntry transitional actions.

Parameters:
step - provides EntryList, TransitList, ExitList gets updated its AfterStatus/Events
stateMachine - state machine - SCXML instance
evtDispatcher - the event dispatcher - EventDispatcher instance
errRep - error reporter
scInstance - The state chart instance
Throws:
ModelException - in case there is a fatal SCXML object model problem.

enumerateReachableTransitions

void enumerateReachableTransitions(SCXML stateMachine,
                                   Step step,
                                   ErrorReporter errRep)
Enumerate all the reachable transitions.

Parameters:
stateMachine - a state machine to traverse
step - with current status and list of transitions to populate
errRep - ErrorReporter callback

filterTransitionsSet

void filterTransitionsSet(Step step,
                          EventDispatcher evtDispatcher,
                          ErrorReporter errRep,
                          SCInstance scInstance)
                          throws ModelException
Filter the transitions set, eliminate those whose guard conditions are not satisfied.

Parameters:
step - with current status
evtDispatcher - the event dispatcher - EventDispatcher instance
errRep - ErrorReporter callback
scInstance - The state chart instance
Throws:
ModelException - in case there is a fatal SCXML object model problem.

followTransitions

void followTransitions(Step step,
                       ErrorReporter errorReporter,
                       SCInstance scInstance)
                       throws ModelException
Follow the candidate transitions for this execution Step, and update the lists of entered and exited states accordingly.

Parameters:
step - The current Step
errorReporter - The ErrorReporter for the current environment
scInstance - The state chart instance
Throws:
ModelException - in case there is a fatal SCXML object model problem.

updateHistoryStates

void updateHistoryStates(Step step,
                         ErrorReporter errRep,
                         SCInstance scInstance)
Go over the exit list and update history information for relevant states.

Parameters:
step - The current Step
errRep - ErrorReporter callback
scInstance - The state chart instance

processInvokes

void processInvokes(TriggerEvent[] events,
                    ErrorReporter errRep,
                    SCInstance scInstance)
                    throws ModelException
Forward events to invoked activities, execute finalize handlers.

Parameters:
events - The events to be forwarded
errRep - ErrorReporter callback
scInstance - The state chart instance
Throws:
ModelException - in case there is a fatal SCXML object model problem.

initiateInvokes

void initiateInvokes(Step step,
                     ErrorReporter errRep,
                     SCInstance scInstance)
Initiate any new invoked activities.

Parameters:
step - The current Step
errRep - ErrorReporter callback
scInstance - The state chart instance


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.