Examples of Split


Examples of org.jbpm.workflow.core.node.Split

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

  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() + "\" ");
View Full Code Here

Examples of org.jbpm.workflow.core.node.Split

        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

Examples of org.jbpm.workflow.core.node.Split

    public void build(Process process,
                      ProcessDescr processDescr,
                      ProcessBuildContext context,
                      Node node) {
        Split splitNode = ( Split ) node;
       
        if ( splitNode.getType() != Split.TYPE_XOR && splitNode.getType() != Split.TYPE_OR ) {
            // we only process or/xor
            return;
        }
        // we need to clone the map, so we can update the original while iterating.
        Map<ConnectionRef, Constraint> map = new HashMap<ConnectionRef, Constraint>( splitNode.getConstraints() );
        for ( Iterator<Map.Entry<ConnectionRef, Constraint>> it = map.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry<ConnectionRef, Constraint> entry = it.next();
            ConnectionRef connection = entry.getKey();
            ConstraintImpl constraint = (ConstraintImpl) entry.getValue();
            Connection outgoingConnection = null;
            for (Connection out: splitNode.getDefaultOutgoingConnections()) {
                if (out.getToType().equals(connection.getToType())
                    && out.getTo().getId() == connection.getNodeId()) {
                    outgoingConnection = out;
                }
            }
            if (outgoingConnection == null) {
                throw new IllegalArgumentException("Could not find outgoing connection");
            }
            if ( "rule".equals( constraint.getType() )) {
                RuleConstraintEvaluator ruleConstraint = new RuleConstraintEvaluator();
                ruleConstraint.setDialect( constraint.getDialect() );
                ruleConstraint.setName( constraint.getName() );
                ruleConstraint.setPriority( constraint.getPriority() );
                ruleConstraint.setDefault( constraint.isDefault() );
                splitNode.setConstraint( outgoingConnection, ruleConstraint );
            } else if ( "code".equals( constraint.getType() ) ) {
                ReturnValueConstraintEvaluator returnValueConstraint = new ReturnValueConstraintEvaluator();
                returnValueConstraint.setDialect( constraint.getDialect() );
                returnValueConstraint.setName( constraint.getName() );
                returnValueConstraint.setPriority( constraint.getPriority() );
                returnValueConstraint.setDefault( constraint.isDefault() );
                splitNode.setConstraint( outgoingConnection, returnValueConstraint );           
               
                ReturnValueDescr returnValueDescr = new ReturnValueDescr();
                returnValueDescr.setText( constraint.getConstraint() );
               
                ProcessDialect dialect = ProcessDialectRegistry.getDialect( constraint.getDialect() );           
View Full Code Here

Examples of org.jbpm.workflow.core.node.Split

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

Examples of org.jbpm.workflow.core.node.Split

        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

Examples of org.jbpm.workflow.core.node.Split

          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());
          }
          constraint.setPriority(connection.getPriority());
          split.addConstraint(
            new ConnectionRef(target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE),
            constraint);
        }
      }
    }
View Full Code Here

Examples of org.jbpm.workflow.core.node.Split

    }
    private void generateRules(Node[] nodes, Process process, StringBuffer builder) {
        for ( int i = 0; i < nodes.length; i++ ) {
            if ( nodes[i] instanceof Split ) {
                Split split = (Split) nodes[i];
                if ( split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR ) {
                    for ( Connection connection : split.getDefaultOutgoingConnections() ) {
                        Constraint constraint = split.getConstraint( connection );
                        if ( "rule".equals( constraint.getType() ) ) {
                            builder.append( createSplitRule( process,
                                                             connection,
                                                             split.getConstraint( connection ).getConstraint() ) );
                        }
                    }
                }
            } else if ( nodes[i] instanceof MilestoneNode ) {
                MilestoneNode milestone = (MilestoneNode) nodes[i];
View Full Code Here

Examples of org.jbpm.workflow.core.node.Split

            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 xsi:type=\"tFormalExpression\" />");
            } else {
                    if (constraint.getName() != null && constraint.getName().trim().length() > 0) {
View Full Code Here

Examples of org.jbpm.workflow.core.node.Split

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

Examples of org.jbpm.workflow.core.node.Split

        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
TOP
Copyright © 2018 www.massapi.com. 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.