Refine search
private void addActiveNodeIds(NodeInstanceContainer container, List<String> result) { for (org.kie.api.runtime.process.NodeInstance nodeInstance: container.getNodeInstances()) { result.add(((NodeImpl) ((NodeInstanceImpl) nodeInstance).getNode()).getUniqueId()); if (nodeInstance instanceof NodeInstanceContainer) { addActiveNodeIds((NodeInstanceContainer) nodeInstance, result); } } }
public void internalTrigger(final NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; addWorkItemListener(); String deploymentId = (String) getProcessInstance().getKnowledgeRuntime().getEnvironment().get(EnvironmentName.DEPLOYMENT_ID); ((WorkItem) workItem).setDeploymentId(deploymentId); ((WorkItem) workItem).setNodeInstanceId(this.getId()); if (isInversionOfControl()) { ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime() .update(((ProcessInstance) getProcessInstance()).getKnowledgeRuntime().getFactHandle(this), this); } else { try { (org.drools.core.process.instance.WorkItem) workItem); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } catch (ProcessWorkItemHandlerException handlerException) {
public void internalTrigger(final NodeInstance from, String type) { super.internalTrigger(from, type); // if node instance was cancelled, abort if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; } if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "A MilestoneNode only accepts default incoming connections!"); } String rule = "RuleFlow-Milestone-" + getProcessInstance().getProcessId() + "-" + getMilestoneNode().getUniqueId(); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup("DROOLS_SYSTEM", rule, getProcessInstance().getId()); if (isActive) { triggerCompleted(); } else { addActivationListener(); } }
public void internalTrigger(NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; timerInstances = new ArrayList<Long>(timers.size()); TimerManager timerManager = ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime().getProcessRuntime()).getTimerManager(); for (Timer timer: timers.keySet()) { TimerInstance timerInstance = createTimerInstance(timer); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup("DROOLS_SYSTEM", name, getProcessInstance().getId()); if (isActive) { getProcessInstance().getKnowledgeRuntime().signalEvent(name, null); } else { addActivationListener();
hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); if (getNodeInstanceContainer() instanceof CompositeNodeInstance) { if (getEndNode().getScope() == EndNode.PROCESS_SCOPE) { getProcessInstance().setState( ProcessInstance.STATE_COMPLETED ); } else { while (!getNodeInstanceContainer().getNodeInstances().isEmpty()) { ((org.jbpm.workflow.instance.NodeInstance) getNodeInstanceContainer().getNodeInstances().iterator().next()).cancel(); ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime);
if ((getNodeInstanceContainer().getNodeInstance(getId()) == null) || (((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getState() != ProcessInstance.STATE_ACTIVE)) { return; hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); .nodeInstanceCompleted(this, type); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime);
public void internalTrigger(final NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; processId = processId.replace("#{" + replacement.getKey() + "}", replacement.getValue()); KieBase kbase = ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime().getKieBase(); ((ProcessInstanceImpl) processInstance).setMetaData("ParentProcessInstanceId", getProcessInstance().getId()); ((ProcessInstanceImpl) processInstance).setMetaData("ParentNodeInstanceId", getUniqueId()); ((ProcessInstanceImpl) processInstance).setMetaData("ParentNodeId", getSubProcessNode().getUniqueId()); ((ProcessInstanceImpl) processInstance).setParentProcessInstanceId(getProcessInstance().getId()); ((ProcessInstanceImpl) processInstance).setSignalCompletion(getSubProcessNode().isWaitForCompletion());
public void internalTrigger(final org.kie.api.runtime.process.NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return;
super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; KieRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); Map<String, Object> inputs = evaluateParameters(ruleSetNode); String inputKey = getRuleFlowGroup() + "_" + getProcessInstance().getId() + "_" + entry.getKey(); ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .activateRuleFlowGroup(getRuleFlowGroup(), getProcessInstance().getId(), getUniqueId()); fireLimit = Integer.parseInt(inputs.get(FIRE_RULE_LIMIT_PARAMETER).toString()); ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .activateRuleFlowGroup(getRuleFlowGroup(), getProcessInstance().getId(), getUniqueId());
public void internalTrigger(NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; timerInstances = new ArrayList<Long>(timers.size()); TimerManager timerManager = ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime().getProcessRuntime()).getTimerManager(); for (Timer timer: timers.keySet()) { TimerInstance timerInstance = createTimerInstance(timer); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup("DROOLS_SYSTEM", name, getProcessInstance().getId()); if (isActive) { getProcessInstance().getKnowledgeRuntime().signalEvent(name, null); } else { addActivationListener();
hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); if (getNodeInstanceContainer() instanceof CompositeNodeInstance) { if (getEndNode().getScope() == EndNode.PROCESS_SCOPE) { getProcessInstance().setState( ProcessInstance.STATE_COMPLETED ); } else { while (!getNodeInstanceContainer().getNodeInstances().isEmpty()) { ((org.jbpm.workflow.instance.NodeInstance) getNodeInstanceContainer().getNodeInstances().iterator().next()).cancel(); ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime);
if ((getNodeInstanceContainer().getNodeInstance(getId()) == null) || (((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getState() != ProcessInstance.STATE_ACTIVE)) { return; hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); .nodeInstanceCompleted(this, type); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeLeft(this, kruntime);
public void internalTrigger(final NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; processId = processId.replace("#{" + replacement.getKey() + "}", replacement.getValue()); KieBase kbase = ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime().getKieBase(); ((ProcessInstanceImpl) processInstance).setMetaData("ParentProcessInstanceId", getProcessInstance().getId()); ((ProcessInstanceImpl) processInstance).setMetaData("ParentNodeInstanceId", getUniqueId()); ((ProcessInstanceImpl) processInstance).setMetaData("ParentNodeId", getSubProcessNode().getUniqueId()); ((ProcessInstanceImpl) processInstance).setParentProcessInstanceId(getProcessInstance().getId()); ((ProcessInstanceImpl) processInstance).setSignalCompletion(getSubProcessNode().isWaitForCompletion());
public NodeInstance getNodeInstance(long nodeInstanceId) { org.kie.api.runtime.process.NodeInstance nodeInstance = delegate.getNodeInstance(nodeInstanceId); if (nodeInstance == null) { return null; } else { return new NodeInstanceAdapter(nodeInstance); } }
public void internalTrigger(final NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; addWorkItemListener(); String deploymentId = (String) getProcessInstance().getKnowledgeRuntime().getEnvironment().get(EnvironmentName.DEPLOYMENT_ID); ((WorkItem) workItem).setDeploymentId(deploymentId); ((WorkItem) workItem).setNodeInstanceId(this.getId()); if (isInversionOfControl()) { ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime() .update(((ProcessInstance) getProcessInstance()).getKnowledgeRuntime().getFactHandle(this), this); } else { try { (org.drools.core.process.instance.WorkItem) workItem); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } catch (ProcessWorkItemHandlerException handlerException) {
@Override public void signalEvent(String type, Object event) { if (getNodeInstanceContainer().getNodeInstances().contains(this) || type.startsWith("Error-") || type.equals("timerTriggered") ) { // start it only if it was not already started - meaning there are node instances if (this.getNodeInstances().isEmpty()) { StartNode startNode = getCompositeNode().findStartNode(); if (resolveVariables(((EventSubProcessNode) getEventBasedNode()).getEvents()).contains(type) || type.equals("timerTriggered")) { NodeInstance nodeInstance = getNodeInstance(startNode); ((StartNodeInstance) nodeInstance).signalEvent(type, event); } } } super.signalEvent(type, event); }
if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; InternalAgenda agenda = (InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda(); String ruleFlowGroup = getRuleFlowGroupName(); if (ruleFlowGroup != null && !agenda.getRuleFlowGroup(ruleFlowGroup).isActive()) { agenda.getRuleFlowGroup(ruleFlowGroup).setAutoDeactivate(false); agenda.activateRuleFlowGroup(ruleFlowGroup, getProcessInstance().getId(), getUniqueId()); String rule = "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getDynamicNode().getUniqueId(); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup(getRuleFlowGroupName(), rule, getProcessInstance().getId()); if (isActive) {
public void internalTrigger(final org.kie.api.runtime.process.NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return;
private boolean existsActiveDirectFlow(NodeInstanceContainer nodeInstanceContainer, final Node lookFor) { Collection<NodeInstance> activeNodeInstancesOrig = nodeInstanceContainer.getNodeInstances(); List<NodeInstance> activeNodeInstances = new ArrayList<NodeInstance>(activeNodeInstancesOrig);
public void internalTrigger(NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return; Constraint constraint = stateNode.getConstraint(connection); if (constraint != null && constraint.getPriority() < priority) { String rule = "RuleFlowStateNode-" + getProcessInstance().getProcessId() + "-" + getStateNode().getUniqueId() + "-" + connection.getTo().getId() + "-" + connection.getToType(); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup("DROOLS_SYSTEM", rule, getProcessInstance().getId()); if (isActive) { selected = connection;