
雙擊 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…