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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations