Package org.jbpm.workflow.core.impl

Examples of org.jbpm.workflow.core.impl.ConnectionRef


        }
        writeTimers(stateNode.getTimers(), xmlDump);
        if (!stateNode.getConstraints().isEmpty()) {
          xmlDump.append("      <constraints>" + EOL);
          for (Map.Entry<ConnectionRef, Constraint> entry: stateNode.getConstraints().entrySet()) {
              ConnectionRef connection = entry.getKey();
              Constraint constraint = entry.getValue();
              xmlDump.append("        <constraint "
                  + "toNodeId=\"" + connection.getNodeId() + "\" ");
              String name = constraint.getName();
              if (name != null && !"".equals(name)) {
                  xmlDump.append("name=\"" + XmlDumper.replaceIllegalChars(constraint.getName()) + "\" ");
              }
              int priority = constraint.getPriority();
View Full Code Here


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

      Constrainable parent = (Constrainable) parser.getParent();
        Constraint constraint = new ConstraintImpl();

        final String toNodeIdString = element.getAttribute("toNodeId");
        String toType = element.getAttribute("toType");
        ConnectionRef connectionRef = null;
        if (toNodeIdString != null && toNodeIdString.trim().length() > 0) {
          int toNodeId = new Integer(toNodeIdString);
          if (toType == null || toType.trim().length() == 0) {
            toType = NodeImpl.CONNECTION_DEFAULT_TYPE;
          }
          connectionRef = new ConnectionRef(toNodeId, toType);
        }

        final String name = element.getAttribute("name");
        constraint.setName(name);
        final String priority = element.getAttribute("priority");
View Full Code Here

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

          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

        if ( connection == null ) {
            throw new IllegalArgumentException( "connection is null" );
        }

        if ( this.type == TYPE_OR || this.type == TYPE_XOR ) {
            ConnectionRef ref = new ConnectionRef(connection.getTo().getId(), connection.getToType());
            return this.constraints.get(ref);
        }
        throw new UnsupportedOperationException( "Constraints are " +
        "only supported with XOR or OR split types, not with: " + getType() );
    }
View Full Code Here

            }
            if (!getDefaultOutgoingConnections().contains(connection)) {
                throw new IllegalArgumentException("connection is unknown:" + connection);
            }
            addConstraint(
                new ConnectionRef(connection.getTo().getId(), connection.getToType()),
                constraint);
        } else {
            throw new UnsupportedOperationException( "Constraints are " +
            "only supported with XOR or OR split types, not with type:" + getType() );
        }
View Full Code Here

        super.removeOutgoingConnection(type, connection);
        removeConstraint(connection);
    }
   
    public void removeConstraint(Connection connection) {
      ConnectionRef ref = new ConnectionRef(connection.getTo().getId(), connection.getToType());
        internalRemoveConstraint(ref);
    }
View Full Code Here

        constraintImpl.setType(type);
        constraintImpl.setDialect(dialect);
        constraintImpl.setConstraint(constraint);
        constraintImpl.setPriority(priority);
        getSplit().addConstraint(
        new ConnectionRef(toNodeId, Node.CONNECTION_DEFAULT_TYPE), constraintImpl);
        return this;
    }
View Full Code Here

      throw new IllegalArgumentException("connection is null");
    }
    if (!getDefaultOutgoingConnections().contains(connection)) {
      throw new IllegalArgumentException("connection is unknown:"  + connection);
    }
    addConstraint(new ConnectionRef(
      connection.getTo().getId(), connection.getToType()), constraint);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.workflow.core.impl.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.