public NodeInstanceResolverFactory(NodeInstance nodeInstance) { this.nodeInstance = nodeInstance; this.extraParameters.put("nodeInstance", nodeInstance); if (nodeInstance.getProcessInstance() != null) { this.extraParameters.put("processInstance", nodeInstance.getProcessInstance()); this.extraParameters.put("processInstanceId", nodeInstance.getProcessInstance().getId()); this.extraParameters.put("parentProcessInstanceId", nodeInstance.getProcessInstance().getParentProcessInstanceId()); } }
public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { Object value; try { ProcessContext context = new ProcessContext(((ProcessInstance)instance.getProcessInstance()).getKnowledgeRuntime()); context.setNodeInstance( instance ); value = this.evaluator.evaluate( context ); } catch ( Exception e ) { throw new RuntimeException( "unable to execute ReturnValueEvaluator: ", e ); } if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + value + " for expression " + constraint); } return ((Boolean) value).booleanValue(); }
public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { WorkflowProcessInstance processInstance = instance.getProcessInstance(); InternalAgenda agenda = (InternalAgenda) ((ProcessInstance) processInstance).getKnowledgeRuntime().getAgenda(); String rule = "RuleFlow-Split-" + processInstance.getProcessId() + "-" + ((Node) instance.getNode()).getUniqueId() + "-" + ((Node) connection.getTo()).getUniqueId() + "-" + connection.getToType(); return agenda.isRuleActiveInRuleFlowGroup( "DROOLS_SYSTEM", rule, processInstance.getId() ); }
public NodeInstanceResolverFactory(NodeInstance nodeInstance) { this.nodeInstance = nodeInstance; this.extraParameters.put("nodeInstance", nodeInstance); if (nodeInstance.getProcessInstance() != null) { this.extraParameters.put("processInstance", nodeInstance.getProcessInstance()); this.extraParameters.put("processInstanceId", nodeInstance.getProcessInstance().getId()); this.extraParameters.put("parentProcessInstanceId", nodeInstance.getProcessInstance().getParentProcessInstanceId()); } }
public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { Object value; try { ProcessContext context = new ProcessContext(((ProcessInstance)instance.getProcessInstance()).getKnowledgeRuntime()); context.setNodeInstance( instance ); value = this.evaluator.evaluate( context ); } catch ( Exception e ) { throw new RuntimeException( "unable to execute ReturnValueEvaluator: ", e ); } if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + value + " for expression " + constraint); } return ((Boolean) value).booleanValue(); }
public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { WorkflowProcessInstance processInstance = instance.getProcessInstance(); InternalAgenda agenda = (InternalAgenda) ((ProcessInstance) processInstance).getKnowledgeRuntime().getAgenda(); String rule = "RuleFlow-Split-" + processInstance.getProcessId() + "-" + ((Node) instance.getNode()).getUniqueId() + "-" + ((Node) connection.getTo()).getUniqueId() + "-" + connection.getToType(); return agenda.isRuleActiveInRuleFlowGroup( "DROOLS_SYSTEM", rule, processInstance.getId() ); }