用Java

时间:2018-01-10 18:23:25

标签: java rule-engine redhat-brms

我们使用Redhat BRMS 6.4作为使用Java开发的应用程序。为了获得更好的日志记录功能,我正在考虑记录在Redhat BRMS中触发的规则。有没有办法可以将BRMS中触发的规则作为回应取回。

KieCommands commandsFactory = KieServices.Factory.get().getCommands();
    String className = getClassNameForRuleEngine(t);
    commands.add(commandsFactory.newInsert(t, className));
    commands.add(commandsFactory.newFireAllRules());
    commands.add(commandsFactory.newGetObjects(GET_DEFAULT_OBJECT_NAME));
    BatchExecutionCommand batchExecution = commandsFactory.newBatchExecution(commands, "ksession");
    RuleServicesClient ruleServicesClient = kieServicesClient.getServicesClient(RuleServicesClient.class);
    ServiceResponse<ExecutionResults> response = ruleServicesClient.executeCommandsWithResults(containerId,
            batchExecution);

1 个答案:

答案 0 :(得分:0)

使用agendaeventlistner,您可以记录在Redhat BRMS中触发的规则

欲了解更多信息,请通过link解释如何使用agendaeventlistner。