use of org.eclipse.bpmn2.Expression in project drools by kiegroup.
the class ExpressionConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
Expression e = (Expression) parent;
if (e.getTypeRef() != null)
writer.addAttribute(TYPE_REF, MarshallingUtils.formatQName(e.getTypeRef()));
}
use of org.eclipse.bpmn2.Expression in project oozie by apache.
the class CoordInputLogicEvaluatorUtil method validateInputLogic.
/**
* Validate input logic.
*
* @throws JDOMException the JDOM exception
* @throws CommandException in case of error
*/
public void validateInputLogic() throws JDOMException, CommandException {
JexlEngine jexl = new OozieJexlEngine();
String expression = CoordUtils.getInputLogic(coordAction.getActionXml().toString());
if (StringUtils.isEmpty(expression)) {
return;
}
Expression e = jexl.createExpression(expression);
JexlContext jc = new OozieJexlParser(jexl, new CoordInputLogicBuilder(new CoordInputLogicEvaluatorPhaseValidate(coordAction)));
try {
Object result = e.evaluate(jc);
log.debug("Input logic expression is [{0}] and evaluate result is [{1}]", expression, result);
} catch (RuntimeException re) {
throw new CommandException(ErrorCode.E1028, re.getCause().getMessage());
}
}
Aggregations