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); } }
public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) { Join join = (Join) node; String type = null; switch (join.getType()) { case Join.TYPE_AND: type = "parallelGateway"; break; case Join.TYPE_XOR: type = "exclusiveGateway"; break; case Join.TYPE_OR: type = "inclusiveGateway"; break; default: type = "complexGateway"; } writeNode(type, node, xmlDump, metaDataType); xmlDump.append("gatewayDirection=\"Converging\" >" + EOL); writeExtensionElements(join, xmlDump); endNode(type, xmlDump); }
public void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); Join joinNode = (Join) node; String type = element.getAttribute("type"); if (type != null && type.length() != 0 ) { joinNode.setType(new Integer(type)); } String n = element.getAttribute("n"); if (n != null && n.length() != 0 ) { joinNode.setN(n); } }
public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) { Join joinNode = (Join) node; writeNode("join", joinNode, xmlDump, includeMeta); int type = joinNode.getType(); if (type != 0) { xmlDump.append("type=\"" + type + "\" "); } if (type == Join.TYPE_N_OF_M) { String n = joinNode.getN(); if (n != null && n.length() != 0) { xmlDump.append("n=\"" + n + "\" "); } } if (includeMeta && containsMetaData(joinNode)) { xmlDump.append(">" + EOL); writeMetaData(joinNode, xmlDump); endNode("join", xmlDump); } else { endNode(xmlDump); } }
process.addNode(eventNode); Join join = new Join(); join.setName("join"); join.setMetaData("x", 1); join.setMetaData("y", 2); join.setMetaData("width", 3); join.setMetaData("height", 4); join.setType(Join.TYPE_N_OF_M); join.setN("#{var1}"); process.addNode(join); new ConnectionImpl(actionNode, Node.CONNECTION_DEFAULT_TYPE, join, Node.CONNECTION_DEFAULT_TYPE);
if (join.getType() == Join.TYPE_UNDEFINED) { addErrorMessage(process, node, "Join has no type."); if (join.getDefaultIncomingConnections().size() < 2) { addErrorMessage(process, node, errors, "Join does not have more than one incoming connection: " + join.getIncomingConnections().size() + "."); if (join.getTo() == null && !acceptsNoOutgoingConnections(node)) { addErrorMessage(process, node, "Join has no outgoing connection."); if (join.getType() == Join.TYPE_N_OF_M) { String n = join.getN(); if (!n.startsWith("#{") || !n.endsWith("}")) { try {
switch ( join.getType() ) { case Join.TYPE_XOR : triggerCompleted(); for (final Connection connection: getJoin().getDefaultIncomingConnections()) { if ( this.triggers.get( connection.getFrom().getId() ) != null ) { counter++; String n = join.getN(); Integer number = null; if (n.startsWith("#{") && n.endsWith("}")) { throw new IllegalArgumentException( "Illegal join type " + join.getType() );
protected Node createNode() { return new Join(); }
public JoinFactory type(int type) { getJoin().setType(type); return this; }
private boolean checkAllActivated() { // check whether all parent nodes have been triggered for (final Connection connection: getJoin().getDefaultIncomingConnections()) { if ( this.triggers.get( connection.getFrom().getId() ) == null ) { return false; } } return true; }
public JoinFactory type(String n) { getJoin().setN(n); return this; }
if (join.getType() == Join.TYPE_UNDEFINED) { addErrorMessage(process, node, "Join has no type."); if (join.getDefaultIncomingConnections().size() < 2) { addErrorMessage(process, node, errors, "Join does not have more than one incoming connection: " + join.getIncomingConnections().size() + "."); if (join.getTo() == null && !acceptsNoOutgoingConnections(node)) { addErrorMessage(process, node, "Join has no outgoing connection."); if (join.getType() == Join.TYPE_N_OF_M) { String n = join.getN(); if (!n.startsWith("#{") || !n.endsWith("}")) { try {
switch ( join.getType() ) { case Join.TYPE_XOR : triggerCompleted(); for (final Connection connection: getJoin().getDefaultIncomingConnections()) { if ( this.triggers.get( connection.getFrom().getId() ) != null ) { counter++; String n = join.getN(); Integer number = null; if (n.startsWith("#{") && n.endsWith("}")) { throw new IllegalArgumentException( "Illegal join type " + join.getType() );
protected Node createNode() { return new Join(); }
public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) { Join joinNode = (Join) node; writeNode("join", joinNode, xmlDump, includeMeta); int type = joinNode.getType(); if (type != 0) { xmlDump.append("type=\"" + type + "\" "); } if (type == Join.TYPE_N_OF_M) { String n = joinNode.getN(); if (n != null && n.length() != 0) { xmlDump.append("n=\"" + n + "\" "); } } if (includeMeta && containsMetaData(joinNode)) { xmlDump.append(">" + EOL); writeMetaData(joinNode, xmlDump); endNode("join", xmlDump); } else { endNode(xmlDump); } }
public JoinFactory type(int type) { getJoin().setType(type); return this; }
private void decreaseAllTriggers() { // decrease trigger count for all incoming connections for (final Connection connection: getJoin().getDefaultIncomingConnections()) { final Integer count = (Integer) this.triggers.get( connection.getFrom().getId() ); if ( count.intValue() == 1 ) { this.triggers.remove( connection.getFrom().getId() ); } else { this.triggers.put( connection.getFrom().getId(), count.intValue() - 1 ); } } }