public interface Context
| Modifier and Type | Field and Description |
|---|---|
static String |
EVENT_NAME |
| Modifier and Type | Method and Description |
|---|---|
void |
addActiveState(State state) |
void |
addStateToInvoke(State state) |
void |
addURLDataHandler(URLDataHandler var) |
void |
addURLDataHandlers(List<URLDataHandler> vars) |
void |
clearAndSetURLDataHandlers(List<URLDataHandler> vars) |
void |
clearStatesToInvoke()
Used by the FSM to clear the states to invoke (after invoke them)
|
void |
createVarIfDontExist(String name,
Object value) |
boolean |
evaluateConditionGuardExpresion(String expresion) |
void |
executeScript(String code) |
void |
executeScript(URL codeUri) |
boolean |
existsVarName(String id) |
SortedSet<State> |
getActiveStates() |
Event |
getCurrentEvent() |
<T> T |
getDataByExpression(String expression) |
<T> T |
getDataByName(String name) |
<T> T |
getDataFromURL(URL url) |
InvokeHandler |
getInvokeHandler(String type) |
Set<InvokeHandler> |
getInvokeHandlers() |
Set<IOProcessor> |
getIOProcessors() |
ContextInstance |
getLastStableConfiguration() |
StateMachineModel |
getModel() |
String |
getParentSessionId() |
IOProcessor |
getScxmlIOProcessor() |
String |
getSessionId() |
String |
getSessionName() |
State |
getState(String targetState) |
SortedSet<State> |
getStatesToInvoke() |
boolean |
hasExternalEvents() |
boolean |
hasInternalEvents() |
boolean |
isActiveState(State state) |
boolean |
isActiveStateByName(String stateName) |
boolean |
isInvokeSessionActive(String invokeSessionId)
This method is called to check if the invoked session is active.
|
void |
loadDataModel(DataModel dataModel) |
void |
offerExternalEvent(Event event)
Adds an event to the external event queue.
|
void |
offerExternalEvent(String eventName)
Adds an event to the external event queue.
|
void |
offerExternalEvent(String eventName,
Object data)
Adds an event to the external event queue.
|
void |
offerInternalEvent(Event event)
Register a new internal event that will be processed by the FSM on the current macrostep.
|
Event |
pollExternalEvent()
Retrieves the next external event.
|
Event |
pollInternalEvent() |
void |
registerInvokeSessionId(String invokeSessionId)
When a invoke is executed this method is called to register in the context so any event sent to this invoke
session could be managed
|
void |
removeActiveState(State state) |
void |
removeDatamodel(DataModel dataModel) |
void |
removeStateToInvoke(State state) |
void |
saveCurrentConfiguration()
The context is a very sensitive part of a FSM session.
|
IOProcessor |
searchIOProcessor(String name)
This is used to send/raise events to generate the origin attribute on the event to be sent.
|
void |
setCurrentEvent(Event event) |
void |
unRegisterInvokeSessionId(String invokeSessionId)
When an invoke is canceled then this method is called to avoid the process of more events (to this invoke
session).
|
void |
updateData(String id,
Object value) |
void |
updateDataIfExists(String id,
Object value) |
static final String EVENT_NAME
void saveCurrentConfiguration()
The context is a very sensitive part of a FSM session. The model, active states, etc. should only be modified by the framework on micro and macro steps.
The FSM framework use this method to save the last stable configuration not exposing internal context.
This protects from outside systems to have incomplete/incongruent configuration and/or to do ilegal modifications on context.
ContextInstance getLastStableConfiguration()
String getSessionId()
String getSessionName()
<scxml name="MyStateMachine">...</scxml> this method will return "MyStateMachine".String getParentSessionId()
IOProcessor searchIOProcessor(String name)
name - the type of processor needed (for example http://www.w3.org/TR/scxml/#SCXMLEventProcessor name).IOProcessor from which the event handler could get the location for this session.IOProcessor getScxmlIOProcessor()
Set<IOProcessor> getIOProcessors()
Set<InvokeHandler> getInvokeHandlers()
InvokeHandler getInvokeHandler(String type)
type - the type of the invoke handlerStateMachineModel getModel()
Event getCurrentEvent()
void setCurrentEvent(Event event)
void offerExternalEvent(String eventName)
event - void offerExternalEvent(String eventName, Object data)
event - void offerExternalEvent(Event event)
event - boolean hasExternalEvents()
Event pollExternalEvent()
boolean hasInternalEvents()
Event pollInternalEvent()
void offerInternalEvent(Event event)
event - void registerInvokeSessionId(String invokeSessionId)
invokeSessionId - void unRegisterInvokeSessionId(String invokeSessionId)
invokeSessionId - boolean isInvokeSessionActive(String invokeSessionId)
invokeSessionId - void clearStatesToInvoke()
void addStateToInvoke(State state)
void removeStateToInvoke(State state)
<T> T getDataByName(String name)
<T> T getDataByExpression(String expression)
boolean existsVarName(String id)
boolean evaluateConditionGuardExpresion(String expresion)
boolean isActiveStateByName(String stateName)
boolean isActiveState(State state)
void addActiveState(State state)
void removeActiveState(State state)
<T> T getDataFromURL(URL url)
void addURLDataHandler(URLDataHandler var)
void addURLDataHandlers(List<URLDataHandler> vars)
void clearAndSetURLDataHandlers(List<URLDataHandler> vars)
void executeScript(String code)
void executeScript(URL codeUri) throws IOException
IOExceptionvoid loadDataModel(DataModel dataModel)
void removeDatamodel(DataModel dataModel)
Copyright © 2015. All rights reserved.