我正在尝试在jbpm流程中使用业务规则。业务规则具有与过程变量关联的输入和输出。
我尝试插入参数并将其传递给该过程。该规则将考虑流程的插入值,而不考虑业务规则。我遵循了这个tuto。我认为我正在循环播放一些内容,请您帮忙。
预期的行为是在控制台输出incrementation firing... New Value:2
中而不是6
中。
以下代码显示了业务规则:
rule "incrementation"
ruleflow-group "incrementInt"
no-loop
when
unEntier : java.lang.Integer()
then
retract( unEntier );
unEntier++;
System.out.println("incrementation firing... New Value:"+unEntier);
insert(unEntier);
end
这就是我所说的过程:
Command c0 = CommandFactory.newInsert(new java.lang.Integer(5));
HashMap<String, Object> h = new HashMap<String, Object>() {
{
put("inint", new java.lang.Integer(1));
}
};
Command c1 = CommandFactory.newStartProcess("test.thirdProcess", h);
kieSession.execute(CommandFactory.newBatchExecution(Arrays.asList(c0, c1)));
这是呼叫输出:
ENTRY: int = 1
11342 [main] ERROR org.jbpm.workflow.instance.node.RuleSetNodeInstance - Could not find variable scope for variable var_test.thirdProcess_inint
11342 [main] ERROR org.jbpm.workflow.instance.node.RuleSetNodeInstance - when trying to execute RuleSetNode Task
11342 [main] ERROR org.jbpm.workflow.instance.node.RuleSetNodeInstance - Continuing without setting parameter.
incrementation firing... New Value:6
11357 [main] WARN org.jbpm.workflow.instance.node.RuleSetNodeInstance - Could not find variable scope for variable var_test.thirdProcess_inint
EXIT: int = 1