KIE Workbench バージョン 6.5.0 でプロジェクトをセットアップし、KIE 実行サーバー 6.5.0 をすべて同じローカルの Wildfly 10 上で実行しています。問題なく動作しています。ステートレスな KieSession で実行されている単純なルールがあり、プロセスも何もありません。ルールが基本情報を検証し、起動された検証に関する情報をグローバル変数に追加することを期待しています。私がテストしている例では、グローバル変数を変更してそれが機能するかどうかを確認しましたが、何らかの理由でサービスから結果が得られず、少なくとも何かがあると予想されます。
これは私が送信する JAXB リクエストです。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<batch-execution lookup="kieSessionStateless">
<insert disconnected="false" entry-point="DEFAULT" return-object="false" out-identifier="myorganization.myproject.bom.MyObject">
<object xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="myObject">
<myDescription>description</myDescription>
<myID>0</myID>
</object>
</insert>
<set-global out-identifier="globalList" identifier="globalList">
<object xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="jaxbListWrapper">
<type>LIST</type>
</object>
</set-global>
<get-objects out-identifier="globalList"/>
<fire-all-rules max="-1"/>
</batch-execution>
実行されるルールは非常に単純です。
rule "MY FIRST RULE"
when
myorganization.myproject.bom.MyObject( myID == 0 )
then
myorganization.myproject.bom.GlobalResponses globalResponses = new myorganization.myproject.bom.GlobalResponses();
globalResponses.setRuleName("MY FIRST RULE");
globalResponses.setRuleResponse("MY ID IS 0");
globalList.add(globalResponses);
System.out.println("MY ID IS 0");
end
そして、Wildfly コンソールに、追加情報 (エラーのスタック トレースなど) なしで出力された行が表示されるので、すべてがうまく機能していると結論付けます。
13:04:36,315 INFO [stdout] (default task-39) MY ID IS 0
しかし、私は常に同じ応答を受け取ります。これは、「プロセス」が正しく終了したことを示しているため (一見したように見えます)、結果に何かがあることを期待しています (空の xml 応答、いくつかのデータを含む xml 応答、 ...):
System.out.println("Message: "+response.getMsg());
System.out.println("Result: "+response.getResult());
System.out.println("Type: "+response.getType());
Message: Container KieContainer successfully called.
Result: null
Type: SUCCESS
Response: ServiceResponse[SUCCESS, msg='Container KieContainer successfully called.']
クライアントは KieServicesClient で呼び出されます。
KieServicesConfiguration config = KieServicesFactory.
newRestConfiguration(urlKieServer,
name,
password);
config.setMarshallingFormat(MarshallingFormat.JAXB);
KieServicesClient client = KieServicesFactory.newKieServicesClient(config);
JAXBContext jaxbContext = DroolsJaxbHelperProviderImpl.createDroolsJaxbContext(classNames, null);
Marshaller marshaller = jaxbContext.createMarshaller();
StringWriter xml = new StringWriter();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(command, System.out);
marshaller.marshal(command, xml);
ServiceResponse<String> response = client.executeCommands("instances/"+containerName, xml.toString());
私は何かが欠けていますが、本当に何がわかりません。
関連するすべてのプロジェクトはGitHubにあります。2 つ以上のリンクを投稿することはできないため、コメントに直接リンクを追加します。
この質問は以下にもあります: Drools ユーザー グループ