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
Modifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
Fields inherited from class org.chenile.stm.action.scriptsupport.BaseScriptingAction
scriptingStrategy
Fields inherited from class org.chenile.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
componentPropertiesHelper, enableInlineScriptsInProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoExecute
(StateEntityType stateEntity) protected String
getExpression
(StateEntityType stateEntity) protected String
getFalseEvent
(StateEntityType stateEntity) protected String
getTrueEvent
(StateEntityType stateEntity) Methods inherited from class org.chenile.stm.action.scriptsupport.BaseScriptingAction
setScriptingStrategy
Methods inherited from class org.chenile.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
getComponentProperty, getComponentProperty, isEnableInlineScriptsInProperties, setComponentPropertiesHelper, setEnableInlineScriptsInProperties
Methods 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:
doExecute
in classSTMActionBase<StateEntityType extends StateEntity>
- Throws:
Exception
-