Class IfAction<StateEntityType extends StateEntity>
java.lang.Object
org.chenile.stm.impl.STMActionBase<StateEntityType>
org.chenile.stm.action.scriptsupport.BaseCustomComponentPropertiesAction<StateEntityType>
org.chenile.stm.action.scriptsupport.BaseScriptingAction<StateEntityType>
org.chenile.stm.action.scriptsupport.IfAction<StateEntityType>
- All Implemented Interfaces:
ComponentPropertiesAware,ScriptingStrategyAware,STMAutomaticStateComputation<StateEntityType>
public class IfAction<StateEntityType extends StateEntity>
extends BaseScriptingAction<StateEntityType>
Implements an IF action using the same expression language as the one supported by the
ScriptingStrategy.
Support custom properties "condition", "then" and "else". If the condition evaluates to true then the "then" event
is returned else the "else" event is returned.
The three attributes can also contain constructs such as ${xxx} which would also be evaluated against the flow context. Ex: <if condition='a == 100' then='enabled' else='disabled'/> if a (which is a property of the StateEntity) is 100 then the enabled event would be returned else the disabled event would be returned.
- Author:
- Raja Shankar Kolluru
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final StringFields inherited from class org.chenile.stm.action.scriptsupport.BaseScriptingAction
scriptingStrategyFields inherited from class org.chenile.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
componentPropertiesHelper, enableInlineScriptsInProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoExecute(StateEntityType stateEntity) protected StringgetExpression(StateEntityType stateEntity) protected StringgetFalseEvent(StateEntityType stateEntity) protected StringgetTrueEvent(StateEntityType stateEntity) Methods inherited from class org.chenile.stm.action.scriptsupport.BaseScriptingAction
setScriptingStrategyMethods inherited from class org.chenile.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
getComponentProperty, getComponentProperty, isEnableInlineScriptsInProperties, setComponentPropertiesHelper, setEnableInlineScriptsInPropertiesMethods inherited from class org.chenile.stm.impl.STMActionBase
cleanUp, doSetup, execute
-
Field Details
-
EXPRESSION
- See Also:
-
FALSE_EVENT
- See Also:
-
TRUE_EVENT
- See Also:
-
-
Constructor Details
-
IfAction
public IfAction()
-
-
Method Details
-
getTrueEvent
- Throws:
Exception
-
getFalseEvent
- Throws:
Exception
-
getExpression
- Throws:
Exception
-
doExecute
- Overrides:
doExecutein classSTMActionBase<StateEntityType extends StateEntity>- Throws:
Exception
-