如何从Drools Rule调用jbpm进程? [英] how to call jbpm process from Drools Rule?

查看:150
本文介绍了如何从Drools Rule调用jbpm进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是,先触发第二条规则,然后停止该过程,而不触发第三条规则

My requirement is,Fire 2nd rule then stop the process without firing 3rd rule

在jBPM流程的中间,使用RuleFlow组(包含3个规则)并触发第一个规则并完成该规则,然后将控制权交给jBPM流程,然后再次触发第2个规则继续执行jB [M流程,依此类推. ...那怎么办呢?

In the middle of jBPM process by using RuleFlow group(contains 3 rules) and fire the 1st rule and completed that rule then give the control to jBPM process and then fire 2nd rule again continue the jB[M process and so on....so how could it will be done ?

例如:

规则"Paycheck"

rule "Paycheck"

ruleflow-group "Order_flow"
when
    $process: WorkflowProcessInstance()

    OrderDetails(price<=1000)from $process.getVariable("orderDetails")

then 

    System.out.println("****** This is Paycheck  from rule ******\n");
    $process.setVariable("price", 2000);

结束

开始---> workflowProcessInstance(数据可在kcontext中获得)---> ruleflowgroup(具有3条规则)----> Fire 1st规则---> paycheck(脚本任务)----> Fire 2nd规则--->欺诈检查(脚本任务)->触发第三条规则---->库存检查(脚本任务)---->结束

start ---> workflowProcessInstance(data available in kcontext)--->ruleflowgroup(with 3 rules)---->Fire 1st rule --->paycheck(Script task)---->Fire 2nd rule --->Fraudcheck(Script task)-->Fire 3rd rule---->inventorycheck(Script task)----> end

推荐答案

您无法告诉规则引擎要触发哪个规则,该引擎将根据激活的RuleFlowGroup和会话中的数据来决定要触发的规则.

You cannot tell the rule engine which rule to fire, the engine will decide what to fire based on the RuleFlowGroup active and the data that is inside the session.

HTH

这篇关于如何从Drools Rule调用jbpm进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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