com.itmusings.stm.action.scriptsupport
Class IfAction<T>

java.lang.Object
  extended by com.itmusings.stm.impl.STMActionBase<T>
      extended by com.itmusings.stm.action.scriptsupport.BaseCustomComponentPropertiesAction<T>
          extended by com.itmusings.stm.action.scriptsupport.BaseScriptingAction<T>
              extended by 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

Field Summary
 
Fields inherited from class com.itmusings.stm.action.scriptsupport.BaseScriptingAction
scriptingStrategy
 
Fields inherited from class com.itmusings.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
componentPropertiesHelper, enableInlineScriptsInProperties
 
Constructor Summary
IfAction()
           
 
Method Summary
 java.lang.String doExecute(T flowContext)
           
protected  java.lang.String getExpression(T flowContext)
           
protected  java.lang.String getFalseEvent(T flowContext)
           
protected  java.lang.String getTrueEvent(T flowContext)
           
 
Methods inherited from class com.itmusings.stm.action.scriptsupport.BaseScriptingAction
setScriptingStrategy
 
Methods inherited from class com.itmusings.stm.action.scriptsupport.BaseCustomComponentPropertiesAction
getComponentProperty, isEnableInlineScriptsInProperties, setComponentPropertiesHelper, setEnableInlineScriptsInProperties
 
Methods inherited from class com.itmusings.stm.impl.STMActionBase
cleanUp, doSetup, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IfAction

public IfAction()
Method Detail

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.