Refine search
protected String getNodeContainerId(NodeContainer nodeContainer) { if (nodeContainer instanceof Node) { return (String) ((Node) nodeContainer).getMetaData().get("UniqueId"); } return null; }
private String createActivationRule(Process process, Node node) { return "rule \"RuleFlow-Activate-" + process.getId() + "-" + node.getMetaData().get("UniqueId") + "\" \n" + " \n" + " when \n" + " org.kie.api.runtime.process.CaseData(definitionId == \"" + process.getId() + "\") \n" + " " + node.getMetaData().get("customActivationExpression") + "\n" + " then \n" + " org.jbpm.casemgmt.api.CaseService caseService = (org.jbpm.casemgmt.api.CaseService) org.jbpm.services.api.service.ServiceRegistry.get().service(org.jbpm.services.api.service.ServiceRegistry.CASE_SERVICE); \n" + " caseService.triggerAdHocFragment(org.jbpm.casemgmt.api.CaseUtils.getCaseId(kcontext.getKieRuntime()), \"" + node.getMetaData().get("customActivationFragmentName") +"\", null); \n" + "end \n\n"; }
public String toString() { return "Compensation Handler [" + this.node.getName() + ", " + this.node.getMetaData().get("UniqueId") + "]"; }
private static Node findNodeByIdOrUniqueIdInMetadata(NodeContainer nodeContainer, final String nodeRef, String errorMsg) { Node node = null; // try looking for a node with same "UniqueId" (in metadata) for (Node containerNode : nodeContainer.getNodes()) { if (nodeRef.equals(containerNode.getMetaData().get("UniqueId"))) { node = containerNode; break; } } if (node == null) { throw new IllegalArgumentException(errorMsg); } return node; }
private static Node findNodeByIdOrUniqueIdInMetadata(NodeContainer nodeContainer, final String nodeRef, String errorMsg) { Node node = null; // try looking for a node with same "UniqueId" (in metadata) for (Node containerNode: nodeContainer.getNodes()) { if (nodeRef.equals(containerNode.getMetaData().get("UniqueId"))) { node = containerNode; break; } } if (node == null) { throw new IllegalArgumentException(errorMsg); } return node; }
public List<Node> getAutoStartNodes() { List<Node> nodes = Arrays.stream(getNodes()) .filter(n -> n.getIncomingConnections().isEmpty() && "true".equalsIgnoreCase((String)n.getMetaData().get("customAutoStart"))) .collect(Collectors.toList()); return nodes; }
public List<Node> getAutoStartNodes() { if (!isDynamic()) { return Collections.emptyList(); } List<Node> nodes = Arrays.stream(getNodes()) .filter(n -> n.getIncomingConnections().isEmpty() && "true".equalsIgnoreCase((String)n.getMetaData().get("customAutoStart"))) .collect(Collectors.toList()); return nodes; }
private Node findNodeByUniqueId(String uniqueId, NodeContainer nodeContainer) { Node result = null; for (Node node : nodeContainer.getNodes()) { if (uniqueId.equals(node.getMetaData().get("UniqueId"))) { return node; } if (node instanceof NodeContainer) { result = findNodeByUniqueId(uniqueId, (NodeContainer) node); if (result != null) { return result; } } } return result; }
protected boolean useAsync(final Node node) { if (!(node instanceof EventSubProcessNode) && (node instanceof ActionNode || node instanceof StateBasedNode || node instanceof EndNode)) { boolean asyncMode = Boolean.parseBoolean((String)node.getMetaData().get("customAsync")); if (asyncMode) { return asyncMode; } return Boolean.parseBoolean((String)getKnowledgeRuntime().getEnvironment().get("AsyncMode")); } return false; }
private void postProcessNodeOffset(Node[] nodes, int xOffset, int yOffset) { for (Node node: nodes) { Integer x = (Integer) node.getMetaData().get("x"); if (x != null) { ((org.jbpm.workflow.core.Node) node).setMetaData("x", x - xOffset); } Integer y = (Integer) node.getMetaData().get("y"); if (y != null) { ((org.jbpm.workflow.core.Node) node).setMetaData("y", y - yOffset); } if (node instanceof NodeContainer) { postProcessNodeOffset(((NodeContainer) node).getNodes(), xOffset + (x == null ? 0 : x), yOffset + (y == null ? 0 : y)); } } }
protected boolean useAsync(final Node node) { if (!(node instanceof EventSubProcessNode) && (node instanceof ActionNode || node instanceof StateBasedNode || node instanceof EndNode)) { boolean asyncMode = Boolean.parseBoolean((String)node.getMetaData().get("customAsync")); if (asyncMode) { return asyncMode; } return Boolean.parseBoolean((String)getProcessInstance().getKnowledgeRuntime().getEnvironment().get("AsyncMode")); } return false; }
public void validateAddOutgoingConnection(final String type, final Connection connection) { super.validateAddOutgoingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] only accepts default outgoing connection type!"); } }
public void validateAddIncomingConnection(final String type, final Connection connection) { super.validateAddIncomingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] only accepts default incoming connection type!"); } if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] cannot have more than one incoming connection!"); } }
public void validateAddOutgoingConnection(final String type, final Connection connection) { super.validateAddOutgoingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] only accepts default outgoing connection type!"); } if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] cannot have more than one outgoing connection!"); } }
public void validateAddIncomingConnection(final String type, final Connection connection) { super.validateAddIncomingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] only accepts default incoming connection type!"); } if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] cannot have more than one incoming connection!"); } }
public void validateAddOutgoingConnection(final String type, final Connection connection) { super.validateAddOutgoingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] only accepts default outgoing connection type!"); } if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] cannot have more than one outgoing connection!"); } }
public void validateAddOutgoingConnection(final String type, final Connection connection) { super.validateAddOutgoingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] only accepts default outgoing connection type!"); } if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getFrom().getMetaData().get("UniqueId") + ", " + connection.getFrom().getName() + "] cannot have more than one outgoing connection!"); } }
public void validateAddIncomingConnection(final String type, final Connection connection) { super.validateAddIncomingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] only accepts default incoming connection type!"); } if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] cannot have more than one incoming connection!"); } }
public void validateAddIncomingConnection(final String type, final Connection connection) { super.validateAddIncomingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] only accepts default incoming connection type!"); } }
public void validateAddIncomingConnection(final String type, final Connection connection) { super.validateAddIncomingConnection(type, connection); if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] only accepts default incoming connection type!"); } if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) { throw new IllegalArgumentException( "This type of node [" + connection.getTo().getMetaData().get("UniqueId") + ", " + connection.getTo().getName() + "] cannot have more than one incoming connection!"); } }