org.enhydra.shark.scripting
Class PythonEvaluator
java.lang.Object
org.enhydra.shark.scripting.PythonEvaluator
- All Implemented Interfaces:
- Evaluator
- public class PythonEvaluator
- extends java.lang.Object
- implements Evaluator
Implementation of the Evaluator interface which evaluates the conditions body as a
Python expression.
Method Summary |
void |
configure(CallbackUtilities cus)
|
boolean |
evaluateCondition(WMSessionHandle shandle,
java.lang.String procId,
java.lang.String actId,
java.lang.String condition,
java.util.Map context)
Evaluate the condition using python as the expression language. |
java.lang.Object |
evaluateExpression(WMSessionHandle shandle,
java.lang.String procId,
java.lang.String actId,
java.lang.String expr,
java.util.Map context,
java.lang.Class resultClass)
Evaluates the given expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PythonEvaluator
public PythonEvaluator()
configure
public void configure(CallbackUtilities cus)
throws java.lang.Exception
- Specified by:
configure
in interface Evaluator
- Throws:
java.lang.Exception
evaluateCondition
public boolean evaluateCondition(WMSessionHandle shandle,
java.lang.String procId,
java.lang.String actId,
java.lang.String condition,
java.util.Map context)
throws java.lang.Exception
- Evaluate the condition using python as the expression language. This method returns
true if the condition is satisfied.
- Specified by:
evaluateCondition
in interface Evaluator
- Parameters:
condition
- The conditioncontext
- The context
- Returns:
- True if the condition is true
- Throws:
java.lang.Exception
evaluateExpression
public java.lang.Object evaluateExpression(WMSessionHandle shandle,
java.lang.String procId,
java.lang.String actId,
java.lang.String expr,
java.util.Map context,
java.lang.Class resultClass)
throws java.lang.Exception
- Evaluates the given expression.
- Specified by:
evaluateExpression
in interface Evaluator
- Parameters:
expr
- The expression Stringcontext
- The workflow contextresultClass
- Returned object should be the instance of this Java class
- Returns:
- True if the expression evaluates to true
- Throws:
java.lang.Exception