Search in sources :

Example 11 with Split

use of io.automatiko.engine.workflow.process.core.node.Split in project automatiko-engine by automatiko-io.

the class SplitNodeHandler method writeNode.

public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    Split splitNode = (Split) node;
    writeNode("split", splitNode, xmlDump, includeMeta);
    int type = splitNode.getType();
    if (type != 0) {
        xmlDump.append("type=\"" + type + "\" ");
    }
    if (splitNode.getConstraints().isEmpty()) {
        endNode(xmlDump);
    } else {
        xmlDump.append(">" + EOL);
        if (includeMeta) {
            writeMetaData(splitNode, xmlDump);
        }
        xmlDump.append("      <constraints>" + EOL);
        for (Map.Entry<ConnectionRef, Constraint> entry : splitNode.getConstraints().entrySet()) {
            ConnectionRef connection = entry.getKey();
            Constraint constraint = entry.getValue();
            xmlDump.append("        <constraint " + "toNodeId=\"" + connection.getNodeId() + "\" " + "toType=\"" + connection.getToType() + "\" ");
            String name = constraint.getName();
            if (name != null && !"".equals(name)) {
                xmlDump.append("name=\"" + XmlDumper.replaceIllegalChars(constraint.getName()) + "\" ");
            }
            int priority = constraint.getPriority();
            if (priority != 0) {
                xmlDump.append("priority=\"" + constraint.getPriority() + "\" ");
            }
            xmlDump.append("type=\"" + constraint.getType() + "\" ");
            String dialect = constraint.getDialect();
            if (dialect != null && !"".equals(dialect)) {
                xmlDump.append("dialect=\"" + dialect + "\" ");
            }
            String constraintString = constraint.getConstraint();
            if (constraintString != null) {
                xmlDump.append(">" + XmlDumper.replaceIllegalChars(constraintString) + "</constraint>" + EOL);
            } else {
                xmlDump.append("/>" + EOL);
            }
        }
        xmlDump.append("      </constraints>" + EOL);
        endNode("split", xmlDump);
    }
}
Also used : Constraint(io.automatiko.engine.workflow.process.core.Constraint) Split(io.automatiko.engine.workflow.process.core.node.Split) Map(java.util.Map) ConnectionRef(io.automatiko.engine.workflow.process.core.impl.ConnectionRef) Constraint(io.automatiko.engine.workflow.process.core.Constraint)

Example 12 with Split

use of io.automatiko.engine.workflow.process.core.node.Split in project automatiko-engine by automatiko-io.

the class ComplexGatewayHandler method createNode.

protected Node createNode(Attributes attrs) {
    final String type = attrs.getValue("gatewayDirection");
    if ("Converging".equals(type)) {
        Join join = new Join();
        join.setType(Join.TYPE_UNDEFINED);
        return join;
    } else if ("Diverging".equals(type)) {
        Split split = new Split();
        split.setType(Split.TYPE_UNDEFINED);
        return split;
    } else {
        throw new IllegalArgumentException("Unknown gateway direction: " + type);
    }
}
Also used : Join(io.automatiko.engine.workflow.process.core.node.Join) Split(io.automatiko.engine.workflow.process.core.node.Split)

Example 13 with Split

use of io.automatiko.engine.workflow.process.core.node.Split in project automatiko-engine by automatiko-io.

the class EventBasedGatewayHandler method createNode.

protected Node createNode(Attributes attrs) {
    final String type = attrs.getValue("gatewayDirection");
    if ("Diverging".equals(type)) {
        Split split = new Split();
        split.setType(Split.TYPE_XAND);
        split.setMetaData("EventBased", "true");
        return split;
    } else {
        throw new IllegalArgumentException("Unknown gateway direction: " + type);
    }
}
Also used : Split(io.automatiko.engine.workflow.process.core.node.Split)

Example 14 with Split

use of io.automatiko.engine.workflow.process.core.node.Split in project automatiko-engine by automatiko-io.

the class ParallelGatewayHandler method createNode.

protected Node createNode(Attributes attrs) {
    final String type = attrs.getValue("gatewayDirection");
    if ("Converging".equals(type)) {
        Join join = new Join();
        join.setType(Join.TYPE_AND);
        return join;
    } else if ("Diverging".equals(type)) {
        Split split = new Split();
        split.setType(Split.TYPE_AND);
        return split;
    } else {
        throw new IllegalArgumentException("Unknown gateway direction: " + type);
    }
}
Also used : Join(io.automatiko.engine.workflow.process.core.node.Join) Split(io.automatiko.engine.workflow.process.core.node.Split)

Example 15 with Split

use of io.automatiko.engine.workflow.process.core.node.Split in project automatiko-engine by automatiko-io.

the class ExclusiveGatewayHandler method createNode.

protected Node createNode(Attributes attrs) {
    final String type = attrs.getValue("gatewayDirection");
    if ("Converging".equals(type)) {
        Join join = new Join();
        join.setType(Join.TYPE_XOR);
        return join;
    } else if ("Diverging".equals(type)) {
        Split split = new Split();
        split.setType(Split.TYPE_XOR);
        String isDefault = attrs.getValue("default");
        split.setMetaData("Default", isDefault);
        return split;
    } else {
        throw new IllegalArgumentException("Unknown gateway direction: " + type);
    }
}
Also used : Join(io.automatiko.engine.workflow.process.core.node.Join) Split(io.automatiko.engine.workflow.process.core.node.Split)

Aggregations

Split (io.automatiko.engine.workflow.process.core.node.Split)19 Join (io.automatiko.engine.workflow.process.core.node.Join)9 Node (io.automatiko.engine.api.definition.process.Node)5 Constraint (io.automatiko.engine.workflow.process.core.Constraint)5 ActionNode (io.automatiko.engine.workflow.process.core.node.ActionNode)5 EndNode (io.automatiko.engine.workflow.process.core.node.EndNode)5 EventNode (io.automatiko.engine.workflow.process.core.node.EventNode)5 StartNode (io.automatiko.engine.workflow.process.core.node.StartNode)5 WorkItemNode (io.automatiko.engine.workflow.process.core.node.WorkItemNode)5 BoundaryEventNode (io.automatiko.engine.workflow.process.core.node.BoundaryEventNode)4 CompositeNode (io.automatiko.engine.workflow.process.core.node.CompositeNode)4 FaultNode (io.automatiko.engine.workflow.process.core.node.FaultNode)4 SubProcessNode (io.automatiko.engine.workflow.process.core.node.SubProcessNode)4 Connection (io.automatiko.engine.api.definition.process.Connection)3 ConnectionRef (io.automatiko.engine.workflow.process.core.impl.ConnectionRef)3 EventSubProcessNode (io.automatiko.engine.workflow.process.core.node.EventSubProcessNode)3 HumanTaskNode (io.automatiko.engine.workflow.process.core.node.HumanTaskNode)3 RuleSetNode (io.automatiko.engine.workflow.process.core.node.RuleSetNode)3 StateNode (io.automatiko.engine.workflow.process.core.node.StateNode)3 TimerNode (io.automatiko.engine.workflow.process.core.node.TimerNode)3