@SuppressWarnings("unchecked") protected void triggerSelectedNode(Node node, Object event) { NodeInstance nodeInstance = getNodeInstance(node); if (event != null) { Map<String, Object> dynamicParams = new HashMap<>(); if (event instanceof Map) { dynamicParams.putAll((Map<String, Object>) event); } else { dynamicParams.put("Data", event); } ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).setDynamicParameters(dynamicParams); } ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE); }
public void internalStart(String trigger) { StartNode startNode = getRuleFlowProcess().getStart(trigger); if (startNode != null) { ((NodeInstance) getNodeInstance(startNode)).trigger(null, null); } else if (!getRuleFlowProcess().isDynamic()) { throw new IllegalArgumentException("There is no start node that matches the trigger " + (trigger == null ? "none" : trigger)); } // activate ad hoc fragments if they are marked as such List<Node> autoStartNodes = getRuleFlowProcess().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> signalEvent(austoStartNode.getName(), null)); }
((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE);
((CompositeNode.CompositeNodeStart) connection.getFrom()).getInNode().getId() == from.getNodeId())) { NodeInstance nodeInstance = getNodeInstance(connection.getFrom()); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, nodeAndType.getType()); return; NodeInstance nodeInstance = getNodeInstance(startNode); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance) .trigger(null, null); found = true;
protected void triggerNodeInstance(org.jbpm.workflow.instance.NodeInstance nodeInstance, String type, boolean fireEvents) { boolean hidden = false; if (getNode().getMetaData().get("hidden") != null) { hidden = true; } InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden && fireEvents) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); } // trigger next node nodeInstance.trigger(this, type); Collection<Connection> outgoing = getNode().getOutgoingConnections(type); for (Connection conn : outgoing) { if (conn.getTo().getId() == nodeInstance.getNodeId()) { this.metaData.put("OutgoingConnection", conn.getMetaData().get("UniqueId")); break; } } if (!hidden && fireEvents) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime); } }
public void internalTrigger(org.kie.api.runtime.process.NodeInstance fromm, String type) { String collectionExpression = getForEachNode().getCollectionExpression(); Collection<?> collection = evaluateCollectionExpression(collectionExpression); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (collection.isEmpty()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, true); } else { List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>(); for (Object o: collection) { String variableName = getForEachNode().getVariableName(); NodeInstance nodeInstance = (NodeInstance) ((NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getForEachSplitNode().getTo().getTo()); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName); variableScopeInstance.setVariable(variableName, o); nodeInstances.add(nodeInstance); } for (NodeInstance nodeInstance: nodeInstances) { logger.debug( "Triggering [{}] in multi-instance loop.", ((NodeInstanceImpl) nodeInstance).getNodeId() ); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(this, getForEachSplitNode().getTo().getToType()); } if (!getForEachNode().isWaitForCompletion()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, false); } } }
.getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); ((org.jbpm.workflow.instance.NodeInstance) entry.getKey()).trigger(this, entry.getValue()); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime())
@SuppressWarnings("unchecked") protected void triggerSelectedNode(Node node, Object event) { NodeInstance nodeInstance = getNodeInstance(node); if (event != null) { Map<String, Object> dynamicParams = new HashMap<>(); if (event instanceof Map) { dynamicParams.putAll((Map<String, Object>) event); } else { dynamicParams.put("Data", event); } ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).setDynamicParameters(dynamicParams); } ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE); }
@Override public void internalTrigger(NodeInstance from, String type) { CompositeNode compositeNode = (CompositeNode) getNode(); for (Node node: compositeNode.getNodes()) { if (node instanceof StartNode) { StartNode startNode = (StartNode) node; if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) { NodeInstance nodeInstance = getNodeInstance(startNode); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, null); } } } }
@Override public void internalTrigger(NodeInstance from, String type) { CompositeNode compositeNode = (CompositeNode) getNode(); for (Node node: compositeNode.getNodes()) { if (node instanceof StartNode) { StartNode startNode = (StartNode) node; if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) { NodeInstance nodeInstance = getNodeInstance(startNode); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, null); } } } }
public void internalStart(String trigger) { StartNode startNode = getRuleFlowProcess().getStart(trigger); if (startNode != null) { ((NodeInstance) getNodeInstance(startNode)).trigger(null, null); } else if (!getRuleFlowProcess().isDynamic()) { throw new IllegalArgumentException("There is no start node that matches the trigger " + (trigger == null ? "none" : trigger)); } // activate ad hoc fragments if they are marked as such List<Node> autoStartNodes = getRuleFlowProcess().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> signalEvent(austoStartNode.getName(), null)); }
((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE);
protected void triggerNodeInstance(org.jbpm.workflow.instance.NodeInstance nodeInstance, String type, boolean fireEvents) { boolean hidden = false; if (getNode().getMetaData().get("hidden") != null) { hidden = true; } InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden && fireEvents) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); } // trigger next node nodeInstance.trigger(this, type); Collection<Connection> outgoing = getNode().getOutgoingConnections(type); for (Connection conn : outgoing) { if (conn.getTo().getId() == nodeInstance.getNodeId()) { this.metaData.put("OutgoingConnection", conn.getMetaData().get("UniqueId")); break; } } if (!hidden && fireEvents) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime); } }
((CompositeNode.CompositeNodeStart) connection.getFrom()).getInNode().getId() == from.getNodeId())) { NodeInstance nodeInstance = getNodeInstance(connection.getFrom()); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, nodeAndType.getType()); return; NodeInstance nodeInstance = getNodeInstance(startNode); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance) .trigger(null, null); found = true;
public void internalTrigger(org.kie.api.runtime.process.NodeInstance fromm, String type) { String collectionExpression = getForEachNode().getCollectionExpression(); Collection<?> collection = evaluateCollectionExpression(collectionExpression); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (collection.isEmpty()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, true); } else { List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>(); for (Object o: collection) { String variableName = getForEachNode().getVariableName(); NodeInstance nodeInstance = (NodeInstance) ((NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getForEachSplitNode().getTo().getTo()); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName); variableScopeInstance.setVariable(variableName, o); nodeInstances.add(nodeInstance); } for (NodeInstance nodeInstance: nodeInstances) { logger.debug( "Triggering [{}] in multi-instance loop.", ((NodeInstanceImpl) nodeInstance).getNodeId() ); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(this, getForEachSplitNode().getTo().getToType()); } if (!getForEachNode().isWaitForCompletion()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, false); } } }
.getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); ((org.jbpm.workflow.instance.NodeInstance) entry.getKey()).trigger(this, entry.getValue()); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime())