Get the rules fired in redhat BRMS back in Java

111 Views Asked by At

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

There are 1 best solutions below

0
Amit Nijhawan On

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.