public class SCXMLSemanticsImpl extends Object implements SCXMLSemantics, Serializable
This class encapsulates a particular SCXML semantics, that is, a particular semantic interpretation of Harel Statecharts, which aligns mostly with W3C SCXML July 5 public draft (that is, UML 1.5). However, certain aspects are taken from STATEMATE.
Specific semantics can be created by subclassing this class.
Constructor and Description |
---|
SCXMLSemanticsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
determineInitialStates(SCXML input,
Set targets,
List entryList,
ErrorReporter errRep,
SCInstance scInstance)
Determining the initial state(s) for this state machine.
|
void |
determineTargetStates(Set states,
ErrorReporter errRep,
SCInstance scInstance) |
void |
enumerateReachableTransitions(SCXML stateMachine,
Step step,
ErrorReporter errRep)
Enumerate all the reachable transitions.
|
protected boolean |
eventMatch(String transEvent,
Set eventOccurrences)
Implements prefix match, that is, if, for example,
"mouse.click" is a member of eventOccurrences and a
transition is triggered by "mouse", the method returns true.
|
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.
|
protected boolean |
finalizeMatch(String parentStateId,
Set eventOccurrences)
Implements event prefix match to ascertain <finalize> execution.
|
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.
|
protected org.apache.commons.logging.Log |
getLog()
Get the log used by this
SCXMLSemantics instance. |
protected Comparator |
getTTComparator()
TransitionTargetComparator factory method.
|
void |
initiateInvokes(Step step,
ErrorReporter errRep,
SCInstance scInstance)
Initiate any new invokes.
|
SCXML |
normalizeStateMachine(SCXML input,
ErrorReporter errRep)
Optional post processing immediately following Digester.
|
void |
processInvokes(TriggerEvent[] events,
ErrorReporter errRep,
SCInstance scInstance)
Process any existing invokes, includes forwarding external events,
and executing any finalize handlers.
|
Set |
seedTargetSet(Set residual,
List transitList,
ErrorReporter errRep)
Populate the target set.
|
protected void |
setLog(org.apache.commons.logging.Log log)
Set the log used by this
SCXMLSemantics instance. |
void |
updateHistoryStates(Step step,
ErrorReporter errRep,
SCInstance scInstance)
Go over the exit list and update history information for
relevant states.
|
public SCXML normalizeStateMachine(SCXML input, ErrorReporter errRep)
SCXMLSemantics
normalizeStateMachine
in interface SCXMLSemantics
input
- SCXML state machineerrRep
- ErrorReporter callbackpublic void determineInitialStates(SCXML input, Set targets, List entryList, ErrorReporter errRep, SCInstance scInstance) throws ModelException
SCXMLSemantics
determineInitialStates
in interface SCXMLSemantics
input
- SCXML state machine [in]targets
- a set of initial targets to populate [out]entryList
- a list of States and Parallels to enter [out]errRep
- ErrorReporter callback [inout]scInstance
- The state chart instance [in]ModelException
- in case there is a fatal SCXML object model problem.public void executeActions(Step step, SCXML stateMachine, EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance) throws ModelException
executeActions
in interface SCXMLSemantics
step
- provides EntryList, TransitList, ExitList gets
updated its AfterStatus/EventsstateMachine
- state machine - SCXML instanceevtDispatcher
- the event dispatcher - EventDispatcher instanceerrRep
- error reporterscInstance
- The state chart instanceModelException
- in case there is a fatal SCXML object model problem.public void enumerateReachableTransitions(SCXML stateMachine, Step step, ErrorReporter errRep)
SCXMLSemantics
enumerateReachableTransitions
in interface SCXMLSemantics
stateMachine
- a SM to traverse [in]step
- with current status and list of transitions to populate
[inout]errRep
- ErrorReporter callback [inout]public void filterTransitionsSet(Step step, EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance) throws ModelException
SCXMLSemantics
filterTransitionsSet
in interface SCXMLSemantics
step
- [inout]evtDispatcher
- The EventDispatcher
[in]errRep
- ErrorReporter callback [inout]scInstance
- The state chart instance [in]ModelException
- in case there is a fatal SCXML object model problem.public Set seedTargetSet(Set residual, List transitList, ErrorReporter errRep)
residual
- [in]transitList
- [in]errRep
- ErrorReporter callback [inout]public void determineTargetStates(Set states, ErrorReporter errRep, SCInstance scInstance) throws ModelException
states
- a set seeded in previous step [inout]errRep
- ErrorReporter callback [inout]scInstance
- The state chart instance [in]ModelException
- On illegal configurationseedTargetSet(Set, List, ErrorReporter)
public void updateHistoryStates(Step step, ErrorReporter errRep, SCInstance scInstance)
updateHistoryStates
in interface SCXMLSemantics
step
- [inout]errRep
- ErrorReporter callback [inout]scInstance
- The state chart instance [inout]public void followTransitions(Step step, ErrorReporter errorReporter, SCInstance scInstance) throws ModelException
followTransitions
in interface SCXMLSemantics
step
- The current SteperrorReporter
- The ErrorReporter for the current environmentscInstance
- The state chart instanceModelException
- in case there is a fatal SCXML object model problem.public void processInvokes(TriggerEvent[] events, ErrorReporter errRep, SCInstance scInstance) throws ModelException
processInvokes
in interface SCXMLSemantics
events
- The events to be forwardederrRep
- ErrorReporter callbackscInstance
- The state chart instanceModelException
- in case there is a fatal SCXML object model problem.public void initiateInvokes(Step step, ErrorReporter errRep, SCInstance scInstance)
initiateInvokes
in interface SCXMLSemantics
step
- The current SteperrRep
- ErrorReporter callbackscInstance
- The state chart instanceprotected boolean eventMatch(String transEvent, Set eventOccurrences)
transEvent
- a trigger event of a transitioneventOccurrences
- current eventsprotected boolean finalizeMatch(String parentStateId, Set eventOccurrences)
parentStateId
- the ID of the parent state of the <invoke> holding
the <finalize>eventOccurrences
- current eventsprotected Comparator getTTComparator()
protected void setLog(org.apache.commons.logging.Log log)
SCXMLSemantics
instance.log
- The new log.protected org.apache.commons.logging.Log getLog()
SCXMLSemantics
instance.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.