Package org.chenile.stm.impl
Class STMFlowStoreImpl
java.lang.Object
org.chenile.stm.impl.STMFlowStoreImpl
- All Implemented Interfaces:
TransientActionsAwareDescriptor,STMFlowStore
- Direct Known Subclasses:
DummyStore
public class STMFlowStoreImpl
extends Object
implements STMFlowStore, TransientActionsAwareDescriptor
A base implementation of STMFlowStore FlowStoreReaders parse various
representations of the flow (such as in an xml or in a db) and call the
addflow() method in this class. Look at XmlFlowReader for an example.
All of the functionality of FlowConfigurator interface is handled by this
class. The only part that is missing is the parsing part which is expected to
be provided by the parsing sub class. Besides flow configurations, other
things such as ScriptingStrategy, entry actions, exit actions and
ComponentPropertiesHelper are handled by this base class.
- Author:
- Raja Shankar Kolluru
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,StateTagDescriptor> private BeanFactoryAdapterprivate ComponentPropertiesHelperprivate STMAutomaticStateComputation<?>protected Stringprotected STMTransitionAction<?>private EnablementStrategyprotected STMAction<?>protected Map<String,EventInformation> protected STMAction<?>protected Map<String,FlowDescriptor> private static final Loggerstatic final Stringprotected StateEntityRetrievalStrategy<? extends StateEntity>private ScriptingStrategyprotected STMActionsInfoProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventInformation(EventInformation eventInformation) voidThis method is called during STD parsing.voidprivate StatecorrectState(State state) StateEntityRetrievalStrategy<? extends StateEntity>STMAction<?>getEntryAction(State state) getEventInformation(String eventId) STMAction<?>getExitAction(State state) getFlowInfo(String flowId) getInitialState(State state) Obtains the correct state descriptor to start operations with given the current state.getSecurityStrategy(String flowId) getStateInfo(String flowId, String stateId) getStateInfo(State state) getTransitionAction(Transition transition) voidmakeAction(String componentName, boolean enableInlineScriptsInProperties) makeAutomaticStateComputation(String componentName, boolean enableInlineScriptsInProperties) makeComponent(String componentName) makeEnablementStrategy(String componentName) makeRetrievalStrategy(String componentName) makeScriptingStrategy(String componentName) makeSecurityStrategy(String componentName) makeTransitionAction(String componentName, boolean enableInlineScriptsInProperties) voidsetBeanFactory(BeanFactoryAdapter beanFactory) voidsetDefaultAutomaticStateComputation(STMAutomaticStateComputation<?> defaultAutomaticStateComputation) voidvoidsetDefaultTransitionAction(String componentName) voidsetDefaultTransitionAction(STMTransitionAction<?> transitionAction) voidsetEnablementStrategy(String componentName) voidsetEnablementStrategy(EnablementStrategy enablementStrategy) voidsetEntryAction(String componentName, boolean enableInlineScriptsInProperties) voidsetEntryAction(STMAction<?> entryAction) voidsetExitAction(String componentName, boolean enableInlineScriptsInProperties) voidsetExitAction(STMAction<?> exitAction) voidsetScriptingStrategy(String componentName) Called during parsing time when the scripting-strategy is defined in the configuration.voidsetScriptingStrategy(ScriptingStrategy scriptingStrategy) toJson()toMap()toString()voidvalidate()Make sure that the state machine is set up right.
-
Field Details
-
LOGGER
-
PATH_TO_DEFAULT_STM_CONFIGURATION
- See Also:
-
actionTagsMap
-
flows
-
eventInfos
-
stmActionsInfoProvider
-
entryAction
-
exitAction
-
defaultFlowId
-
beanFactory
-
retrievalStrategy
-
scriptingStrategy
-
componentPropertiesHelper
-
defaultTransitionAction
-
enablementStrategy
-
defaultAutomaticStateComputation
-
-
Constructor Details
-
STMFlowStoreImpl
public STMFlowStoreImpl()Always initialize the action tags first
-
-
Method Details
-
include
- Throws:
Exception
-
getStateInfo
-
getFlow
-
addStateTag
-
addFlow
This method is called during STD parsing. Every flow would result in a call to this so that the flow gets added to the configuration.- Parameters:
fd- flow descriptor
-
setDefaultFlow
-
makeComponent
- Throws:
STMException
-
makeTransitionAction
public Object makeTransitionAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
makeAction
public Object makeAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
makeAutomaticStateComputation
public Object makeAutomaticStateComputation(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
validate
Make sure that the state machine is set up right.- Throws:
Exception
-
getFlowInfo
-
getFlowInfo
-
setEntryAction
public void setEntryAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
setExitAction
public void setExitAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
setDefaultTransitionAction
- Throws:
STMException
-
setDefaultTransitionAction
-
getDefaultFlowId
-
setScriptingStrategy
Called during parsing time when the scripting-strategy is defined in the configuration. In case of XML configuration, this method is called when the <scripting-strategy ...> xml element is encountered during parsing- Parameters:
componentName-- Throws:
STMException
-
makeScriptingStrategy
- Throws:
STMException
-
makeSecurityStrategy
- Throws:
STMException
-
makeRetrievalStrategy
- Throws:
STMException
-
setScriptingStrategy
-
makeEnablementStrategy
- Throws:
STMException
-
setEnablementStrategy
- Throws:
STMException
-
setEnablementStrategy
-
getEntryAction
- Specified by:
getEntryActionin interfaceSTMFlowStore- Returns:
- the entry action for the state.
-
getExitAction
- Specified by:
getExitActionin interfaceSTMFlowStore- Returns:
- the exit action for the state
-
getTransitionAction
- Specified by:
getTransitionActionin interfaceSTMFlowStore
-
getAutomaticStateComputation
- Specified by:
getAutomaticStateComputationin interfaceSTMFlowStore
-
correctState
-
getStateInfo
- Specified by:
getStateInfoin interfaceSTMFlowStore- Returns:
- the state info.
-
getInitialState
Description copied from interface:STMFlowStoreObtains the correct state descriptor to start operations with given the current state.- Specified by:
getInitialStatein interfaceSTMFlowStore- Returns:
- the initial state for the particular flow if the flow was specified. initial state of the default flow if flow unspecified.
- Throws:
STMException
-
setEntryAction
- Specified by:
setEntryActionin interfaceTransientActionsAwareDescriptor
-
setExitAction
- Specified by:
setExitActionin interfaceTransientActionsAwareDescriptor
-
getBeanFactory
-
setBeanFactory
-
getDefaultRetrievalStrategy
- Specified by:
getDefaultRetrievalStrategyin interfaceSTMFlowStore- Returns:
-
getSecurityStrategy
- Specified by:
getSecurityStrategyin interfaceSTMFlowStore- Returns:
-
toString
-
toJson
-
toMap
-
addEventInformation
-
getEventInformation
- Specified by:
getEventInformationin interfaceSTMFlowStore
-
getAllStates
- Specified by:
getAllStatesin interfaceSTMFlowStore
-
getDefaultFlow
- Specified by:
getDefaultFlowin interfaceSTMFlowStore
-
getEnablementStrategy
-
getDefaultAutomaticStateComputation
-
setDefaultAutomaticStateComputation
public void setDefaultAutomaticStateComputation(STMAutomaticStateComputation<?> defaultAutomaticStateComputation)
-