com.itmusings.stm.action.scriptsupport
Class IfAction<T>
java.lang.Object
com.itmusings.stm.impl.STMActionBase<T>
com.itmusings.stm.action.scriptsupport.BaseCustomComponentPropertiesAction<T>
com.itmusings.stm.action.scriptsupport.BaseScriptingAction<T>
com.itmusings.stm.action.scriptsupport.IfAction<T>
- All Implemented Interfaces:
- ComponentPropertiesAware, ScriptingStrategyAware, STMAction<T>
public class IfAction<T>
- extends BaseScriptingAction<T>
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 flow context) is 100 then the enabled event would be returned else
the disabled event would be returned.
- Author:
- Raja Shankar Kolluru
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IfAction
public IfAction()
getTrueEvent
protected java.lang.String getTrueEvent(T flowContext)
throws java.lang.Exception
- Throws:
java.lang.Exception
getFalseEvent
protected java.lang.String getFalseEvent(T flowContext)
throws java.lang.Exception
- Throws:
java.lang.Exception
getExpression
protected java.lang.String getExpression(T flowContext)
throws java.lang.Exception
- Throws:
java.lang.Exception
doExecute
public java.lang.String doExecute(T flowContext)
throws java.lang.Exception
- Overrides:
doExecute
in class STMActionBase<T>
- Throws:
java.lang.Exception
Copyright © 2011 ITMUSINGS. All Rights Reserved.