Search in sources :

Example 11 with ConnectionRef

use of io.automatiko.engine.workflow.process.core.impl.ConnectionRef in project automatiko-engine by automatiko-io.

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.getParentContainer().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.getParentContainer().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(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)

Aggregations

ConnectionRef (io.automatiko.engine.workflow.process.core.impl.ConnectionRef)11 Constraint (io.automatiko.engine.workflow.process.core.Constraint)7 Split (io.automatiko.engine.workflow.process.core.node.Split)3 Map (java.util.Map)3 ReturnValueConstraintEvaluator (io.automatiko.engine.workflow.base.instance.impl.ReturnValueConstraintEvaluator)2 ConstraintImpl (io.automatiko.engine.workflow.process.core.impl.ConstraintImpl)2 StateNode (io.automatiko.engine.workflow.process.core.node.StateNode)2 Parameter (com.github.javaparser.ast.body.Parameter)1 EnclosedExpr (com.github.javaparser.ast.expr.EnclosedExpr)1 IntegerLiteralExpr (com.github.javaparser.ast.expr.IntegerLiteralExpr)1 LambdaExpr (com.github.javaparser.ast.expr.LambdaExpr)1 LongLiteralExpr (com.github.javaparser.ast.expr.LongLiteralExpr)1 NameExpr (com.github.javaparser.ast.expr.NameExpr)1 StringLiteralExpr (com.github.javaparser.ast.expr.StringLiteralExpr)1 BlockStmt (com.github.javaparser.ast.stmt.BlockStmt)1 ReturnStmt (com.github.javaparser.ast.stmt.ReturnStmt)1 UnknownType (com.github.javaparser.ast.type.UnknownType)1 Node (io.automatiko.engine.api.definition.process.Node)1 Variable (io.automatiko.engine.workflow.base.core.context.variable.Variable)1 EventFilter (io.automatiko.engine.workflow.base.core.event.EventFilter)1