private String getActivationEventType() { return "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getDynamicNode().getUniqueId(); }
public void nodeInstanceCompleted(org.jbpm.workflow.instance.NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } String completionCondition = getDynamicNode().getCompletionExpression(); // TODO what if we reach the end of one branch but others might still need to be created ? // TODO are we sure there will always be node instances left if we are not done yet? if (isTerminated(nodeInstance)) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } else if (getDynamicNode().isAutoComplete() && getNodeInstances(false).isEmpty()) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } else if (completionCondition != null && "mvel".equals(getDynamicNode().getLanguage())) { Object value = MVELSafeHelper.getEvaluator().eval(completionCondition, new NodeInstanceResolverFactory(this)); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Completion condition expression must return boolean values: " + value + " for expression " + completionCondition); } if (((Boolean) value).booleanValue()) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } } }
String rule = "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getDynamicNode().getUniqueId(); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup(getRuleFlowGroupName(), rule, getProcessInstance().getId()); List<Node> autoStartNodes = getDynamicNode().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> triggerSelectedNode(austoStartNode, null));
private String getActivationEventType() { return "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getDynamicNode().getUniqueId(); }
public void nodeInstanceCompleted(org.jbpm.workflow.instance.NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } String completionCondition = getDynamicNode().getCompletionExpression(); // TODO what if we reach the end of one branch but others might still need to be created ? // TODO are we sure there will always be node instances left if we are not done yet? if (isTerminated(nodeInstance)) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } else if (getDynamicNode().isAutoComplete() && getNodeInstances(false).isEmpty()) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } else if (completionCondition != null && "mvel".equals(getDynamicNode().getLanguage())) { Object value = MVELSafeHelper.getEvaluator().eval(completionCondition, new NodeInstanceResolverFactory(this)); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Completion condition expression must return boolean values: " + value + " for expression " + completionCondition); } if (((Boolean) value).booleanValue()) { triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } } }
String rule = "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getDynamicNode().getUniqueId(); boolean isActive = ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()) .isRuleActiveInRuleFlowGroup(getRuleFlowGroupName(), rule, getProcessInstance().getId()); List<Node> autoStartNodes = getDynamicNode().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> triggerSelectedNode(austoStartNode, null));