@Override public long getId() { return node.getId(); }
public void setProcess(final Process process) { this.processId = process.getId(); this.process = ( Process ) process; }
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 Constraint getConstraint(final Connection connection) { if (connection == null) { throw new IllegalArgumentException("connection is null"); } ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType()); return this.constraints.get(ref); }
private String createSplitRule(Process process, Connection connection, String constraint) { return "rule \"RuleFlow-Split-" + process.getId() + "-" + ((org.jbpm.workflow.core.Node) connection.getFrom()).getUniqueId() + "-" + ((org.jbpm.workflow.core.Node) connection.getTo()).getUniqueId() + "-" + connection.getToType() + "\" @Propagation(EAGER) \n" + " ruleflow-group \"DROOLS_SYSTEM\" \n" + " when \n" + " " + constraint + "\n" + " then \n" + "end \n\n"; }
protected String getNodeContainerId(NodeContainer nodeContainer) { if (nodeContainer instanceof Node) { return (String) ((Node) nodeContainer).getMetaData().get("UniqueId"); } return null; }
public Process getProcess(Collection<Process> processes, String name) { for ( Process process : processes ) { if ( process.getName().equals( name ) ) { return process; } } return null; }
public void triggerNode(long nodeId, boolean fireEvents) { org.jbpm.workflow.instance.NodeInstance nodeInstance = (org.jbpm.workflow.instance.NodeInstance) ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()) .getNodeInstance(getNode().getNodeContainer().getNode(nodeId)); triggerNodeInstance(nodeInstance, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, fireEvents); }
@Override public boolean accept(Process process, Resource resource) { if (RuleFlowProcess.RULEFLOW_TYPE.equals(process.getType())) { return true; } return false; }
private boolean acceptsNoOutgoingConnections(Node node) { NodeContainer nodeContainer = node.getNodeContainer(); return nodeContainer instanceof DynamicNode || (nodeContainer instanceof WorkflowProcess && ((WorkflowProcess) nodeContainer).isDynamic()); }
public Constraint getConstraint(final Connection connection) { if ( connection == null ) { throw new IllegalArgumentException( "connection is null" ); } ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType()); return this.constraints.get(ref); }
public NodeAndType(Node node, String type) { if (node == null || type == null) { throw new IllegalArgumentException( "Node or type may not be null!"); } this.nodeId = node.getId(); this.node = node; this.type = type; }
private String createAdHocCompletionRule(Process process, DynamicNode dynamicNode) { return "rule \"RuleFlow-AdHocComplete-" + process.getId() + "-" + dynamicNode.getUniqueId() + "\" @Propagation(EAGER) \n" + " ruleflow-group \"DROOLS_SYSTEM\" \n" + " when \n" + " " + dynamicNode.getCompletionExpression() + "\n" + " then \n" + "end \n\n"; }
private boolean acceptsNoIncomingConnections(Node node) { NodeContainer nodeContainer = node.getNodeContainer(); return nodeContainer instanceof DynamicNode || (nodeContainer instanceof WorkflowProcess && ((WorkflowProcess) nodeContainer).isDynamic()); }
private String createAdHocActivationRule(Process process, DynamicNode dynamicNode) { return "rule \"RuleFlow-AdHocActivate-" + process.getId() + "-" + dynamicNode.getUniqueId() + "\" @Propagation(EAGER) \n" + " ruleflow-group \"DROOLS_SYSTEM\" \n" + " when \n" + " " + dynamicNode.getActivationExpression() + "\n" + " then \n" + "end \n\n"; }
public CompositeNodeEnd(CompositeNode parentNode, Node outNode, String outType) { setName("Composite node end"); this.outNodeId = outNode.getId(); this.outNode = outNode; this.outType = outType; this.parentNode = parentNode; setMetaData("hidden", true); }
private String createMilestoneRule(Process process, MilestoneNode milestone) { return "rule \"RuleFlow-Milestone-" + process.getId() + "-" + milestone.getUniqueId() + "\" @Propagation(EAGER) \n" + " ruleflow-group \"DROOLS_SYSTEM\" \n" + " when \n" + " " + milestone.getConstraint() + "\n" + " then \n" + "end \n\n"; }
public CompositeNodeStart(CompositeNode parentNode, Node outNode, String outType) { setName("Composite node start"); this.inNodeId = outNode.getId(); this.inNode = outNode; this.inType = outType; this.parentNode = parentNode; setMetaData("hidden", true); }