use of net.sourceforge.processdash.data.compiler.ListStack in project processdash by dtuma.
the class Iff method call.
/** Perform a procedure call.
*
* This method <b>must</b> be thread-safe.
*/
public Object call(List arguments, ExpressionContext context) {
if (arguments.size() < 2)
return null;
SimpleData test = getArg(arguments, 0);
Object result = null;
if (test != null && test.test())
result = arguments.get(1);
else if (arguments.size() > 2)
result = arguments.get(2);
if (result instanceof CompiledScript) {
try {
CompiledScript script = (CompiledScript) result;
ListStack stack = new ListStack();
script.run(stack, context);
result = stack.pop();
} catch (Exception e) {
}
}
return result;
}
Aggregations