SequenceFlow connection = new SequenceFlow(id, sourceRef, targetRef); connection.setBendpoints(bendpoints); connection.setName(name); if (priority != null) { connection.setPriority(Integer.parseInt(priority));
public static void linkConnections(NodeContainer nodeContainer, List<SequenceFlow> connections) { if (connections != null) { for (SequenceFlow connection: connections) { String sourceRef = connection.getSourceRef(); Node source = findNodeByIdOrUniqueIdInMetadata(nodeContainer, sourceRef, "Could not find source node for connection:" + sourceRef); String targetRef = connection.getTargetRef(); Node target = findNodeByIdOrUniqueIdInMetadata(nodeContainer, targetRef, "Could not find target node for connection:" + targetRef); source, NodeImpl.CONNECTION_DEFAULT_TYPE, target, NodeImpl.CONNECTION_DEFAULT_TYPE); result.setMetaData("bendpoints", connection.getBendpoints()); result.setMetaData("UniqueId", connection.getId()); Constraint constraint = buildConstraint(connection, nodeImpl); if (constraint != null) { nodeImpl.addConstraint(new ConnectionRef(connection.getId(), target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE), constraint); Constraint constraint = buildConstraint(connection, split); split.addConstraint( new ConnectionRef(connection.getId(), target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE), constraint);
private static Constraint buildConstraint(SequenceFlow connection, NodeImpl node) { if (connection.getExpression() == null) { return null; } Constraint constraint = new ConstraintImpl(); String defaultConnection = (String) node.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()); return constraint; }
public Map<String, Object> getMetaData() { if (parent instanceof Node) { return ((Node) parent).getMetaData(); } else if (parent instanceof RuleFlowProcess) { return ((RuleFlowProcess) parent).getMetaData(); } else if (parent instanceof Variable) { return ((Variable) parent).getMetaData(); } else if (parent instanceof SequenceFlow) { return ((SequenceFlow) parent).getMetaData(); } else if(parent instanceof Lane) { return ((Lane) parent).getMetaData(); } else { throw new IllegalArgumentException("Unknown parent " + parent); } } public DataType getType() {
public Map<String, Object> getMetaData() { if (parent instanceof Node) { return ((Node) parent).getMetaData(); } else if (parent instanceof RuleFlowProcess) { return ((RuleFlowProcess) parent).getMetaData(); } else if (parent instanceof Variable) { return ((Variable) parent).getMetaData(); } else if (parent instanceof SequenceFlow) { return ((SequenceFlow) parent).getMetaData(); } else if(parent instanceof Lane) { return ((Lane) parent).getMetaData(); } else { throw new IllegalArgumentException("Unknown parent " + parent); } } public DataType getType() {
private static Constraint buildConstraint(SequenceFlow connection, NodeImpl node) { if (connection.getExpression() == null) { return null; } Constraint constraint = new ConstraintImpl(); String defaultConnection = (String) node.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()); return constraint; }
public static void linkConnections(NodeContainer nodeContainer, List<SequenceFlow> connections) { if (connections != null) { for (SequenceFlow connection: connections) { String sourceRef = connection.getSourceRef(); Node source = findNodeByIdOrUniqueIdInMetadata(nodeContainer, sourceRef, "Could not find source node for connection:" + sourceRef); String targetRef = connection.getTargetRef(); Node target = findNodeByIdOrUniqueIdInMetadata(nodeContainer, targetRef, "Could not find target node for connection:" + targetRef); source, NodeImpl.CONNECTION_DEFAULT_TYPE, target, NodeImpl.CONNECTION_DEFAULT_TYPE); result.setMetaData("bendpoints", connection.getBendpoints()); result.setMetaData("UniqueId", connection.getId()); Constraint constraint = buildConstraint(connection, nodeImpl); if (constraint != null) { nodeImpl.addConstraint(new ConnectionRef(connection.getId(), target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE), constraint); Constraint constraint = buildConstraint(connection, split); split.addConstraint( new ConnectionRef(connection.getId(), target.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE), constraint);
SequenceFlow connection = new SequenceFlow(id, sourceRef, targetRef); connection.setBendpoints(bendpoints); connection.setName(name); if (priority != null) { connection.setPriority(Integer.parseInt(priority));