プロセス変数をビジネス ルール タスクに入れ、このタスクでこの変数を変更しようとしましたが、値は同じままです。私は何を間違っていますか?プロセスは、Eclipse を使用せずに kie ワークベンチで開発されます。
ルールが実行される前にスクリプト タスクで初期化された変数
kcontext.setVariable("triggers",new com.embeddedwireless.healthdesk.InitialTriggers(false,false,false,false));
kcontext.setVariable("answers",new com.embeddedwireless.healthdesk.InitialAnswers("not","not","not","not","not","not","not","not","not","not","not","not","not","not","not","not","not","twice","not"));
ルールは次のようになります
package com.embeddedwireless.healthdesk;
import com.embeddedwireless.healthdesk.InitialAnswers
import com.embeddedwireless.healthdesk.InitialTriggers
rule "BehavioralHealth" ruleflow-group "InitialCheck"
no-loop
lock-on-active
salience 1
when
answers : InitialAnswers( q9a in ( "always", "most", "some" ) || q10a in ( "always", "most", "some" ) || q12a in ( "always", "most", "some" ) )
triggers_out : InitialTriggers()
then
System.out.println("Beh!!!!");
triggers_out.setBehavioral( true );
update( triggers_out );
end
rule "OccupationalRule" ruleflow-group "InitialCheck"
no-loop
lock-on-active
salience 2
when
answers : InitialAnswers( q3a in ( "some", "rare", "not" ) || q3b in ( "some", "rare", "not" ) || q4a in ( "some", "rare", "not" ) || q7b in ( "always", "most", "some" ) )
triggers_out : InitialTriggers()
then
System.out.println("Occupation!!!!");
triggers_out.setOccupational( true );
update( triggers_out );
end
rule "PhysicalRule" ruleflow-group "InitialCheck"
no-loop
lock-on-active
salience 3
when
answers : InitialAnswers( q1a in ( "some", "rare", "not" ) || q1b in ( "some", "rare", "not" ) || q2a in ( "some", "rare", "not" ) || q2b in ( "some", "rare", "not" ) || q11a in ( "always", "most", "some" ) || q11b in ( "once", "twice", "more", "often" ) )
triggers_out:InitialTriggers()
then
System.out.println("Phys!!!!");
triggers_out.setPhysical( true );
update( triggers_out );
end
rule "Speech Rule" ruleflow-group "InitialCheck"
no-loop
lock-on-active
salience 4
when
answers : InitialAnswers( q7a in ( "always", "most", "some" ) )
triggers_out : InitialTriggers()
then
System.out.println("Speech!!!!");
triggers_out.setSpeech( true );
update( triggers_out );
end
トリガー変数が変更されるのを待っていますが、そのままです
InitialTriggers{physical=false, occupational=false, speech=false, behavioral=false}
データ割り当ては問題なく、Tomcat ログには「Phys!!!!」などのデバッグ メッセージが含まれています。私は何を間違っていますか?
助けてくれてありがとう!