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