Search in sources :

Example 16 with Constraint

use of org.jbpm.workflow.core.Constraint in project jbpm by kiegroup.

the class SplitHandler method writeNode.

public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) {
    Split split = (Split) node;
    String type = null;
    switch(split.getType()) {
        case Split.TYPE_AND:
            type = "parallelGateway";
            writeNode(type, node, xmlDump, metaDataType);
            break;
        case Split.TYPE_XOR:
            type = "exclusiveGateway";
            writeNode(type, node, xmlDump, metaDataType);
            for (Map.Entry<ConnectionRef, Constraint> entry : split.getConstraints().entrySet()) {
                if (entry.getValue() != null && entry.getValue().isDefault()) {
                    xmlDump.append("default=\"" + XmlBPMNProcessDumper.getUniqueNodeId(split) + "-" + XmlBPMNProcessDumper.getUniqueNodeId(node.getNodeContainer().getNode(entry.getKey().getNodeId())) + "\" ");
                    break;
                }
            }
            break;
        case Split.TYPE_OR:
            type = "inclusiveGateway";
            writeNode(type, node, xmlDump, metaDataType);
            for (Map.Entry<ConnectionRef, Constraint> entry : split.getConstraints().entrySet()) {
                if (entry.getValue() != null && entry.getValue().isDefault()) {
                    xmlDump.append("default=\"" + XmlBPMNProcessDumper.getUniqueNodeId(split) + "-" + XmlBPMNProcessDumper.getUniqueNodeId(node.getNodeContainer().getNode(entry.getKey().getNodeId())) + "\" ");
                    break;
                }
            }
            break;
        case Split.TYPE_XAND:
            type = "eventBasedGateway";
            writeNode(type, node, xmlDump, metaDataType);
            break;
        default:
            type = "complexGateway";
            writeNode(type, node, xmlDump, metaDataType);
    }
    xmlDump.append("gatewayDirection=\"Diverging\" >" + EOL);
    writeExtensionElements(node, xmlDump);
    endNode(type, xmlDump);
}
Also used : Constraint(org.jbpm.workflow.core.Constraint) Split(org.jbpm.workflow.core.node.Split) Map(java.util.Map) ConnectionRef(org.jbpm.workflow.core.impl.ConnectionRef)

Aggregations

Constraint (org.jbpm.workflow.core.Constraint)16 ConnectionRef (org.jbpm.workflow.core.impl.ConnectionRef)8 Split (org.jbpm.workflow.core.node.Split)8 ConstraintImpl (org.jbpm.workflow.core.impl.ConstraintImpl)6 StateNode (org.jbpm.workflow.core.node.StateNode)6 Connection (org.kie.api.definition.process.Connection)6 Map (java.util.Map)5 EventNode (org.jbpm.workflow.core.node.EventNode)4 StartNode (org.jbpm.workflow.core.node.StartNode)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 EventTypeFilter (org.jbpm.process.core.event.EventTypeFilter)3 ConnectionImpl (org.jbpm.workflow.core.impl.ConnectionImpl)3 ActionNode (org.jbpm.workflow.core.node.ActionNode)3 CompositeContextNode (org.jbpm.workflow.core.node.CompositeContextNode)3 EndNode (org.jbpm.workflow.core.node.EndNode)3 FaultNode (org.jbpm.workflow.core.node.FaultNode)3 NodeInstanceContainer (org.jbpm.workflow.instance.NodeInstanceContainer)3 List (java.util.List)2 ReturnValueDescr (org.drools.compiler.compiler.ReturnValueDescr)2