Search in sources :

Example 6 with SequenceFlow

use of org.jbpm.bpmn2.core.SequenceFlow in project jbpm by kiegroup.

the class ProcessHandler method end.

@SuppressWarnings("unchecked")
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    parser.endElementBuilder();
    RuleFlowProcess process = (RuleFlowProcess) parser.getCurrent();
    List<IntermediateLink> throwLinks = (List<IntermediateLink>) process.getMetaData(LINKS);
    linkIntermediateLinks(process, throwLinks);
    List<SequenceFlow> connections = (List<SequenceFlow>) process.getMetaData(CONNECTIONS);
    linkConnections(process, connections);
    linkBoundaryEvents(process);
    // This must be done *after* linkConnections(process, connections)
    // because it adds hidden connections for compensations
    List<Association> associations = (List<Association>) process.getMetaData(ASSOCIATIONS);
    linkAssociations((Definitions) process.getMetaData("Definitions"), process, associations);
    List<Lane> lanes = (List<Lane>) process.getMetaData(LaneHandler.LANES);
    assignLanes(process, lanes);
    postProcessNodes(process, process);
    return process;
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) Association(org.jbpm.bpmn2.core.Association) SequenceFlow(org.jbpm.bpmn2.core.SequenceFlow) Lane(org.jbpm.bpmn2.core.Lane) List(java.util.List) ArrayList(java.util.ArrayList) IntermediateLink(org.jbpm.bpmn2.core.IntermediateLink)

Example 7 with SequenceFlow

use of org.jbpm.bpmn2.core.SequenceFlow in project jbpm by kiegroup.

the class SequenceFlowHandler method end.

public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    SequenceFlow sequenceFlow = (SequenceFlow) parser.getCurrent();
    org.w3c.dom.Node xmlNode = element.getFirstChild();
    while (xmlNode != null) {
        String nodeName = xmlNode.getNodeName();
        if ("conditionExpression".equals(nodeName)) {
            String expression = xmlNode.getTextContent();
            org.w3c.dom.Node languageNode = xmlNode.getAttributes().getNamedItem("language");
            if (languageNode != null) {
                String language = languageNode.getNodeValue();
                if (XmlBPMNProcessDumper.JAVA_LANGUAGE.equals(language)) {
                    sequenceFlow.setLanguage("java");
                } else if (XmlBPMNProcessDumper.MVEL_LANGUAGE.equals(language)) {
                    sequenceFlow.setLanguage("mvel");
                } else if (XmlBPMNProcessDumper.RULE_LANGUAGE.equals(language)) {
                    sequenceFlow.setType("rule");
                } else if (XmlBPMNProcessDumper.XPATH_LANGUAGE.equals(language)) {
                    sequenceFlow.setLanguage("XPath");
                } else if (XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE.equals(language)) {
                    sequenceFlow.setLanguage("JavaScript");
                } else {
                    throw new IllegalArgumentException("Unknown language " + language);
                }
            }
            sequenceFlow.setExpression(expression);
        }
        xmlNode = xmlNode.getNextSibling();
    }
    return sequenceFlow;
}
Also used : SequenceFlow(org.jbpm.bpmn2.core.SequenceFlow) Element(org.w3c.dom.Element)

Aggregations

SequenceFlow (org.jbpm.bpmn2.core.SequenceFlow)7 List (java.util.List)5 Association (org.jbpm.bpmn2.core.Association)3 ArrayList (java.util.ArrayList)2 IntermediateLink (org.jbpm.bpmn2.core.IntermediateLink)2 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)2 CompositeContextNode (org.jbpm.workflow.core.node.CompositeContextNode)2 CompositeNode (org.jbpm.workflow.core.node.CompositeNode)2 Lane (org.jbpm.bpmn2.core.Lane)1 EventFilter (org.jbpm.process.core.event.EventFilter)1 EventTypeFilter (org.jbpm.process.core.event.EventTypeFilter)1 Connection (org.jbpm.workflow.core.Connection)1 Constraint (org.jbpm.workflow.core.Constraint)1 NodeContainer (org.jbpm.workflow.core.NodeContainer)1 ConnectionImpl (org.jbpm.workflow.core.impl.ConnectionImpl)1 ConnectionRef (org.jbpm.workflow.core.impl.ConnectionRef)1 ExtendedNodeImpl (org.jbpm.workflow.core.impl.ExtendedNodeImpl)1 NodeImpl (org.jbpm.workflow.core.impl.NodeImpl)1 ActionNode (org.jbpm.workflow.core.node.ActionNode)1 BoundaryEventNode (org.jbpm.workflow.core.node.BoundaryEventNode)1