简体   繁体   中英

Get the rules fired in redhat BRMS back in Java

We are using Redhat BRMS 6.4 for our application which is developed using Java. For better logging capabilities, I was thinking of logging the rules fired in Redhat BRMS. Is there a way we can get back the rules fired in BRMS back as response.

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);

Using agendaeventlistner you can log the rules fired in Redhat BRMS

For more info,pleasego through the link which explain that how to use agendaeventlistner.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM