Search in sources :

Example 16 with Expression

use of org.jbpm.bpmn2.core.Expression in project kogito-runtimes by kiegroup.

the class CorrelationPropertyHandler method buildMessagePathExpression.

private Expression buildMessagePathExpression(NodeList childNodes, ExtensibleXmlParser parser) {
    for (int i = 0; i < childNodes.getLength(); i++) {
        Node node = childNodes.item(i);
        if ("messagePath".equals(node.getNodeName())) {
            Element expressionElement = (Element) node;
            Expression expression = new Expression();
            expression.setId(expressionElement.getAttribute("id"));
            expression.setLang(expressionElement.getAttribute("language"));
            expression.setScript(expressionElement.getTextContent());
            expression.setOutcomeType(HandlerUtil.definitions(parser).get(expressionElement.getAttribute("evaluatesToTypeRef")).getStructureRef());
            return expression;
        }
    }
    throw new RuntimeException("message Path not found for correlation property " + parser.getCurrent());
}
Also used : Expression(org.jbpm.bpmn2.core.Expression) Node(org.w3c.dom.Node) Element(org.w3c.dom.Element)

Aggregations

Element (org.w3c.dom.Element)10 HashMap (java.util.HashMap)8 Expression (org.jbpm.bpmn2.core.Expression)8 SequenceFlow (org.jbpm.bpmn2.core.SequenceFlow)7 Node (org.w3c.dom.Node)6 List (java.util.List)5 Map (java.util.Map)4 ItemDefinition (org.jbpm.bpmn2.core.ItemDefinition)4 ProcessBuildData (org.jbpm.compiler.xml.ProcessBuildData)4 ArrayList (java.util.ArrayList)3 Collection (java.util.Collection)3 HashSet (java.util.HashSet)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 BaseAbstractHandler (org.drools.core.xml.BaseAbstractHandler)3 ExtensibleXmlParser (org.drools.core.xml.ExtensibleXmlParser)3 Handler (org.drools.core.xml.Handler)3 Association (org.jbpm.bpmn2.core.Association)3 Definitions (org.jbpm.bpmn2.core.Definitions)3 Error (org.jbpm.bpmn2.core.Error)3 Lane (org.jbpm.bpmn2.core.Lane)3