私は現在、https ://github.com/FuseByExample/camel-drools-example にある camel-drools の例に基づいて構築しています。
ルートは次のとおりです。
<route trace="false" id="testRoute">
<description>Example route that will regularly create a Person with a random age and verify their age</description>
<from uri="timer:testRoute"/>
<bean method="createTestPerson" ref="personHelper"/>
<to uri="drools:node1/ksession1?action=insertBody" id="AgeVerification">
<description>valid 'action' values are:
'execute' that takes a 'Command' object (default)
'insertBody' that inserts the Exchange.in.body, and executes rules
'insertMessage' that inserts the Exchange.in (type org.apache.camel.Message), and executes rules
'insertExchange' that inserts the Exchange (type org.apache.camel.Exchange), and executes rules
</description>
</to>
<choice>
<when id="CanDrink">
<simple>${body.canDrink}</simple>
<log logName="Bar" message="Person ${body.name} can go to the bar"/>
</when>
<otherwise>
<log logName="Home" message="Person ${body.name} is staying home"/>
</otherwise>
</choice>
</route>
私は自分のプロジェクト用にこの例を拡張し、より複雑なルールとさまざまなファクトを追加しました。これをデバッグしたいと思いますが、キャメル/ヒューズ環境で Drools デバッグを機能させる方法がわかりません。
アジェンダ ビュー、ワーキング メモリ ビューなど、Drools IDE が提供するさまざまなデバッグ ビューをすべて表示したいと考えています ( http://docs.jboss.org/drools/release/5.5.0.Final/のとおり)。 drools-expert-docs/html/ch06.html#d0e8478 )。Eclipse プロジェクトを Drools プロジェクトに変換しました。新しい「Drools アプリケーション」デバッグ構成を作成しましたが、「メイン クラス」セクションに何を入れればよいかわかりません。ルールの実行を呼び出してファクトを作業メモリに挿入するのはラクダなので、私は独自のメイン クラスを持っていません。
アプリケーションを通常の Java アプリケーションとしてデバッグしようとしたので、アプリケーションの drools 部分が実行される前にブレークポイントを設定しました。通常のブレークポイントを設定して workingMemory 変数をクリックすると、drools の 'Working memory' または 'Agenda' ビューに入力する必要があるという drools のドキュメントに従いましたが、常に 'The selected working memory is empty' と表示されます。そうではないことはわかっていますが。考えられるすべての WorkingMemory 変数をクリックしてコードを最初から最後までステップ実行しましたが、「選択した作業メモリが空です」というエラーが表示されます。
camel を使用してデプロイしたときに、誰かが drools を正常にデバッグできましたか? もしそうなら、あなたはどのような措置を講じましたか?
乾杯。