Package org.drools.workflow.core.node

Examples of org.drools.workflow.core.node.Split$ConnectionRef


                  for (Timer timer: ruleSetNode.getTimers().keySet()) {
                    validateTimer(timer, node, process, errors);
                  }
                }
            } else if (node instanceof Split) {
                final Split split = (Split) node;
                if (split.getType() == Split.TYPE_UNDEFINED) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] has no type."));
                }
                if (split.getFrom() == null && !acceptsNoIncomingConnections(node)) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection."));
                }
                if (split.getDefaultOutgoingConnections().size() < 2) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] does not have more than one outgoing connection: " + split.getOutgoingConnections().size() + "."));
                }
                if (split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR ) {
                    for ( final Iterator<Connection> it = split.getDefaultOutgoingConnections().iterator(); it.hasNext(); ) {
                        final Connection connection = it.next();
                        if (split.getConstraint(connection) == null) {
                            errors.add(new ProcessValidationErrorImpl(process,
                                "Split node '" + node.getName() + "' [" + node.getId() + "] does not have a constraint for " + connection.toString() + "."));
                        }
                    }
                }
View Full Code Here


        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);
        }
View Full Code Here

        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);
        }
View Full Code Here

public class InclusiveGatewayHandler extends AbstractNodeHandler {
   
    protected Node createNode(Attributes attrs) {
        final String type = attrs.getValue("gatewayDirection");
        if ("Diverging".equals(type)) {
          Split split = new Split();
          split.setType(Split.TYPE_OR);
          String isDefault = attrs.getValue("default");
          split.setMetaData("Default", isDefault);
          return split;
        } else {
          throw new IllegalArgumentException(
          "Unknown gateway direction: " + type);
        }
View Full Code Here

  public Class generateNodeFor() {
        return Split.class;
    }

  public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) {
    Split split = (Split) node;
    switch (split.getType()) {
      case Split.TYPE_AND:
        writeNode("parallelGateway", node, xmlDump, metaDataType);
        break;
      case Split.TYPE_XOR:
        writeNode("exclusiveGateway", node, xmlDump, metaDataType);
        for (Map.Entry<ConnectionRef, Constraint> entry: split.getConstraints().entrySet()) {
          if (entry.getValue().isDefault()) {
            xmlDump.append("default=\"" +
              XmlBPMNProcessDumper.getUniqueNodeId(split) + "-" +
              XmlBPMNProcessDumper.getUniqueNodeId(node.getNodeContainer().getNode(entry.getKey().getNodeId())) +
              "\" ");
            break;
          }
        }
        break;
      case Split.TYPE_OR:
                writeNode("inclusiveGateway", node, xmlDump, metaDataType);
        for (Map.Entry<ConnectionRef, Constraint> entry: split.getConstraints().entrySet()) {
          if (entry.getValue().isDefault()) {
            xmlDump.append("default=\"" +
              XmlBPMNProcessDumper.getUniqueNodeId(split) + "-" +
              XmlBPMNProcessDumper.getUniqueNodeId(node.getNodeContainer().getNode(entry.getKey().getNodeId())) +
              "\" ");
View Full Code Here

        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);
        }
View Full Code Here

          source, NodeImpl.CONNECTION_DEFAULT_TYPE,
          target, NodeImpl.CONNECTION_DEFAULT_TYPE);
        result.setMetaData("bendpoints", connection.getBendpoints());
        result.setMetaData("UniqueId", connection.getId());
        if (source instanceof Split) {
          Split split = (Split) source;
          Constraint constraint = new ConstraintImpl();
          String defaultConnection = (String) split.getMetaData("Default");
          if (defaultConnection != null && defaultConnection.equals(connection.getId())) {
            constraint.setDefault(true);
          }
          if (connection.getName() != null) {
            constraint.setName(connection.getName());
          } else {
            constraint.setName("");
          }
          if (connection.getType() != null) {
            constraint.setType(connection.getType());
          } else {
            constraint.setType("code");
          }
          if (connection.getLanguage() != null) {
            constraint.setDialect(connection.getLanguage());
          }
          if (connection.getExpression() != null) {
            constraint.setConstraint(connection.getExpression());
          }
          split.addConstraint(
            new ConnectionRef(target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE),
            constraint);
        }
      }
    }
View Full Code Here

            if (bendpoints != null) {
                xmlDump.append("g:bendpoints=\"" + bendpoints + "\" ");
            }
        }
        if (connection.getFrom() instanceof Split) {
          Split split = (Split) connection.getFrom();
          if (split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR) {
            Constraint constraint = split.getConstraint(connection);
            if (constraint == null) {
                xmlDump.append(">" + EOL +
              "      <conditionExpression xs:type=\"tFormalExpression\" />");
            } else {
                    if (constraint.getName() != null && constraint.getName().trim().length() > 0) {
View Full Code Here

public class EventBasedGatewayHandler extends AbstractNodeHandler {
   
    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);
        }
View Full Code Here

                if (ruleFlowGroup == null || "".equals(ruleFlowGroup)) {
                    errors.add( new ProcessValidationErrorImpl(process,
                        "RuleSet node '" + node.getName() + "' [" + node.getId() + "] has no ruleflow-group."));
                }
            } else if (node instanceof Split) {
                final Split split = (Split) node;
                if (split.getType() == Split.TYPE_UNDEFINED) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] has no type."));
                }
                if (split.getFrom() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection."));
                }
                if (split.getDefaultOutgoingConnections().size() < 2) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Split node '" + node.getName() + "' [" + node.getId() + "] does not have more than one outgoing connection: " + split.getOutgoingConnections().size() + "."));
                }
                if (split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR ) {
                    for ( final Iterator<Connection> it = split.getDefaultOutgoingConnections().iterator(); it.hasNext(); ) {
                        final Connection connection = it.next();
                        if (split.getConstraint(connection) == null) {
                            errors.add(new ProcessValidationErrorImpl(process,
                                "Split node '" + node.getName() + "' [" + node.getId() + "] does not have a constraint for " + connection.toString() + "."));
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.drools.workflow.core.node.Split$ConnectionRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.