私は1つのプロジェクトで2つのガイド付きデシジョンテーブルを持っています。私の要件は、任意の時点で1つのデシジョン・テーブルに属するルールだけを実行することです。私はFireAllRulesCommandクラスでRuleNameEndsWithAgendaFilter( "some suffix")を使用しようとしましたが、Kieサーバは渡されたAgendaFilterに基づいてルールをフィルタリングしていません。毎回すべてのルールを実行します。Drools KieサーバーがAgendaFilterを無視する
Drools Workbenchバージョン7.2.0.FinalおよびDrools Kie Serverバージョン7.2.0.Final。
以下は同じのためのコードスニペットです:一つのテーブルからのルールは同じ結末を持っていないので、
KieServicesConfiguration configuration = KieServicesFactory.newRestConfiguration(serverUrl, user, password);
Set<Class<?>> allClasses = new HashSet<Class<?>>();
allClasses.add(OrderItem.class);
configuration.addExtraClasses(allClasses);
configuration.setMarshallingFormat(MarshallingFormat.JAXB);
OrderItem oi = new OrderItem("Mobile", 7000.00, 0.00, "");
KieServicesClient client = KieServicesFactory.newKieServicesClient(configuration);
// work with rules
List<ExecutableCommand<?>> commands = new ArrayList<ExecutableCommand<?>>();
BatchExecutionCommandImpl executionCommand = new BatchExecutionCommandImpl(commands, "defaultKieSession");
InsertObjectCommand insertObjectCommand = new InsertObjectCommand();
insertObjectCommand.setOutIdentifier("orderItem");
insertObjectCommand.setObject(oi);
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
fireAllRulesCommand.setAgendaFilter(new RuleNameEndsWithAgendaFilter("MyRuleSuffix", true));
commands.add(insertObjectCommand);
commands.add(fireAllRulesCommand);
RuleServicesClient ruleClient = client.getServicesClient(RuleServicesClient.class);
ServiceResponse<String> response = ruleClient.executeCommands(containerId, executionCommand);
System.out.println(response.getResult());
アジェンダフィルタのコードを入力しない限り、これが正しいかどうかをどのように判断できますか?また、ルール表の最上位の行(おそらくCSVテキスト)。 – laune
デフォルトの実装はdrools-core jar(バージョン:7.2.0.Final) –