IBM-ILOG JRules 开发-布署-实例-R8


双击 archive.xml 将打开 RuleApp 的属性。在 Ruleset Archives 选项卡上,可设置规则集属性来控制规则集的运行时行为。要启用规则集监视(稍后将介绍),添加了以下规则集属性:

ruleset.bom.enabled = true

monitoring.enabled = true

ruleset.debug.enabled = true

ruleset.trace.enabled = true

5 显示了指定这些属性后 ccc-ruleapp 的规则集归档属性。

5. 规则集归档属性


(查看  5 的更大版本。)

部署 RuleApp

可通过双击 RuleApp 项目中的 archive.xml 调用 RuleApp 编辑器,轻松地从 Rule Studio 部署 RuleApp。从 RuleApp 编辑器,单击 deploy 直接将 RuleApp 部署到正在运行的应用程序服务器,这个应用程序服务器可以是远程的或本地的。当然,这个应用程序服务器应安装并配置了 Rule Execution Server,而且您需要知道身份验证凭据。对于本案例分析,我们使用与 WebSphere ILOG JRules 相捆绑且已安装了 Rule Execution Server WebSphere Application Server Community Edition,而且将默认凭据用于 Rule Execution Server 中的身份验证。

6 显示了用于将 RuleApp 部署到 Rule Execution Server 的步骤顺序。要部署 RuleApp,执行以下步骤:

1.     ccc-ruleapp 的概述中的 Deployment 部分选择 Deploy 超链接。

2.    在打开的窗口中,选择 Replace RuleApp version 作为部署类型并单击 Next

3.    在下一个窗口中,选择 Create a temporary Rule Execution Server configuration 单选按钮,提供并接受默认凭据(使用 “resAdmin” 作为登录名和密码),单击 Finish

6. RuleApp 部署


(查看  6 的更大版本。)

使用 Rule Execution Server 调用 RuleApp

现在,您可使用 Rule Execution Server 控制台管理和监视 RuleApp,可通过 http.//<res_server>.8080/res 访问它。从该控制台,我们可浏览服务器上部署的 RuleApp。在我们的案例分析中,因为我们有一个动态 XOM,也就是一个基于 XSD XOM,所以 Rule Execution Server 会自动将它公开为 Web 服务,以供通过外部客户端调用。Web 服务的 WSDL 接口可通过 Rule Execution Server 控制台访问,只需单击 Ruleset View 中的 Get HTDS WSDL for this ruleset version 即可,如  7 所示。

7. Rule Execution Server 控制台


现在,WSDL 已分发到外部客户端,决策服务已准备好供这些外部客户端调用。要执行一些快捷且简单的测试,我们可使用 SOAP UI 等工具向此决策服务发送 XML 请求。清单 1 提供了一个可用于 SOAP UI 的示例 SOAP 请求。

清单 1. SOAP 请求示例

<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”

xmlns:dec=”http://www.ilog.com/rules/DecisionService”

xmlns:par=”http://www.ilog.com/rules/param”

xmlns:urn=”urn:oasis:names:tc:emergency:cap:1.1″

xmlns=”urn:oasis:names:tc:emergency:cap:1.1″>

<soapenv:Header/>

<soapenv:Body>

<dec:DecisionServiceRequest>

<!–Optional:–>

<dec:DecisionID>5</dec:DecisionID>

<par:request>

<alert>

<identifier>MSG1</identifier>

<sender>CityCommandCenter-EPS</sender>

<sent>2010-10-05T02:30:00+00:00</sent>

<status>System</status>

<msgType>Alert</msgType>

<scope>Private</scope>

<addresses>CityCommandCenter-BRE</addresses>

<info>

<language>en-US</language>

<category>Met</category>

<event>HeavyRainfall</event>

<responseType>Assess</responseType>

<urgency>Immediate</urgency>

<severity>Severe</severity>

<certainty>Observed</certainty>

<expires>2010-11-15T16:00:00+00:00</expires>

<senderName>NATIONAL WEATHER SERVICE ROTTERDAM NL</senderName>

<headline>SEVERE THUNDERSTORM WARNING</headline>

<description>AT 254 PM PDT…NATIONAL WEATHER SERVICE DOPPLER RADAR

INDICATED A SEVERE THUNDERSTORM OVER ROTTERDAM CITY..

OR ABOUT 18 MILES SOUTHEAST OF ROTTERDAM…MOVING SOUTHWEST AT 5 MPH.

HAIL…INTENSE RAIN AND STRONG DAMAGING WINDS ARE LIKELY WITH

THIS STORM.</description>

以下文章点击率最高

Loading…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营