jBPM 6中的规则 [英] Rules in jBPM 6

查看:319
本文介绍了jBPM 6中的规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jbpm 6中创建了一个进程。有一个类Person,具有名称和年龄属性。在处理表单中,输入人员的姓名和年龄。该过程中的第一个节点是查看细节的人工任务。第二个节点是一个XOR网关,在它的圆弧上有流口水表达式,如Person(age> 20)和Person(age< 20)。

I have created a process in jbpm 6. There is a class Person, with attributes name and age. In the process form, the name and age of the person is entered. The first node in the process is a human task to view the details. The second node is an XOR gateway with drools expression on its arcs like Person(age > 20) and Person (age < 20).

现在,当我执行流程实例时,第一次人工工作正常,但是当到达网关时,我可以看到此错误-

Now when I execute the process instance, the first human tasks works fine, but when it reaches the gateway, I can see this error -


XOR拆分找不到至少一个有效的传出连接for
split Gateway。

"XOR split could not find at least one valid outgoing connection for split Gateway".

任何想法都错了。

推荐答案

包含流口水表达式的网关仅适用于事实,不适用于过程变量。如果要在网关中使用drools表达式,则需要将流程变量(或整个流程实例)作为事实插入。您可以通过使用脚本节点来执行此操作,这是人工任务中的外发动作。

Gateways containing drools expressions only work with facts and not with process variables. If you want to make use of a drools expression in your gateways, you will need to insert the process variable (or the whole process instance) as a fact. You can do so by using a script node, an outgoing action in your human task.

摘自文档


规则约束无法直接访问流程中定义的变量。但是,可以通过将流程实例添加到工作内存中并在规则约束中匹配该流程实例,来在规则约束内引用当前流程实例。 .......请注意,您有责任自己将流程实例插入会话中,并可能进行更新,例如,使用Java代码或您中的入场,出场或显式操作处理。

Rule constraints do not have direct access to variables defined inside the process. It is however possible to refer to the current process instance inside a rule constraint, by adding the process instance to the Working Memory and matching for the process instance in your rule constraint. ....... Note that you are however responsible yourself to insert the process instance into the session and, possibly, to update it, for example, using Java code or an on-entry or on-exit or explicit action in your process.

希望有帮助,

这篇关于jBPM 6中的规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆