1 package org.jbpm.bpel.data.xpath; 2 3 import java.util.List ; 4 5 import org.jaxen.*; 6 import org.jaxen.function.StringFunction; 7 8 15 public class GetLinkStatusFunction implements Function { 16 17 public Object call(Context context, List args) throws FunctionCallException { 18 if (args.size() != 1) { 19 throw new FunctionCallException("getLinkStatus() requires one argument"); 20 } 21 return evaluate(args.get(0), context); 22 } 23 24 public static Boolean evaluate(Object arg, Context context) throws FunctionCallException { 25 String variableName = StringFunction.evaluate(arg, context.getNavigator()); 26 VariableContext variableContext = context.getContextSupport().getVariableContext(); 27 try { 28 return (Boolean ) variableContext.getVariableValue(null, null, variableName); 29 } 30 catch (UnresolvableException e) { 31 throw new FunctionCallException("variable not found: " + variableName); 32 } 33 } 34 } | Popular Tags |