Search in sources :

Example 46 with Expression

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()));
}
Also used : Expression(org.kie.dmn.model.v1_1.Expression)

Example 47 with Expression

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());
    }
}
Also used : JexlEngine(org.apache.commons.jexl2.JexlEngine) Expression(org.apache.commons.jexl2.Expression) JexlContext(org.apache.commons.jexl2.JexlContext) CommandException(org.apache.oozie.command.CommandException)

Aggregations

Expression (org.kie.workbench.common.dmn.api.definition.v1_1.Expression)19 Expression (org.apache.commons.jexl2.Expression)14 JexlContext (org.apache.commons.jexl2.JexlContext)12 JexlEngine (org.apache.commons.jexl2.JexlEngine)9 MapContext (org.apache.commons.jexl2.MapContext)8 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)7 Expression (org.eclipse.xtext.resource.bug385636.Expression)7 ExpressionCellValue (org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue)7 BaseExpressionGrid (org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid)6 ArrayList (java.util.ArrayList)5 Expression (org.kie.dmn.model.v1_1.Expression)5 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)5 BaseGridCellValue (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue)5 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)4 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)4 ExpressionEditorDefinition (org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinition)4 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)4 CompiledExpression (org.kie.dmn.feel.lang.CompiledExpression)3 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)3 HashMap (java.util.HashMap)2