0

我是 drools 的新手,并且有一个场景,我需要从 drools 调用 mule 流。我已经定义了如下的 mule 流程,并希望根据某些条件调用其中一个流程。

<flow name="Flow1">
    <http:listener config-ref="flw1" path="/check1" doc:name="Evaluation Srv" />

    <http:request config-ref="Proxy" path="/check1" method="GET" doc:name="basic validation" />
</flow>

<flow name="Flow2">
    <http:listener config-ref="flw1" path="/check2" doc:name="Notification" />

    <http:request config-ref="Proxy" path="/check2" method="GET" doc:name="Personal validation">
    </http:request>
</flow>

我有一个示例 drools 文件,如下所示

#default dialect for the semantic code will be MVEL
global org.mule.module.bpm.MessageService mule;

import com.mule.sbus.drools.RequestUrl

dialect "mvel"

declare RequestUrl
    @role(event)
end

rule "/check1"
    lock-on-active
when
    $url:RequestUrl(url=="check1")
then
    #invoke flow1
end

rule "/check2"
    lock-on-active
when
    $url:RequestUrl(url=="check2")
then
    #invoke flow 2
end

请让我知道如何从流口水调用流程

4

1 回答 1

1

如果您知道如何从 Java 调用它,那么您就知道如何从 Drools 调用它。规则的右手边(然后是一部分)基本上是 Java 代码。不过要记住的一件事是,Drools 中规则的执行是单线程的。当您在规则中调用 mule 时,不会执行/评估其他规则。

一种选择是使用异步执行器。

希望能帮助到你,

于 2016-04-20T08:06:48.270 回答