I am a bit new to drools. I have 2 rules namely DateYYYYMMDD and TotalChargesAndTax in my drl file. I am using the following syntax to execute the 2 rules from my main method.
Command<?> syntacticValidation = new FireAllRulesCommand(
new RuleNameEqualsAgendaFilter("DateYYYYMMDD"));
Command<?> semanticValidation = new FireAllRulesCommand(
new RuleNameEqualsAgendaFilter("TotalChargesAndTax"));
List<Command> commands = new ArrayList<Command>();
commands.add(semanticValidation);
commands.add(syntacticValidation);
session.execute(CommandFactory
.newBatchExecution(commands));
But when I run my application, only the TotalChargesAndTax rule is executed and the DateYYYYMMDD rule is skipped. If I interchange the position of the command objects in the ArayList as shown below,
commands.add(syntacticValidation);
commands.add(semanticValidation);
then the DateYYYYMMDD rule is executed and the TotalChargesAndTax rule is skipped. Is there a way to execute both the rules and execute the consequence of both the rules? As of now, only one consequence is executed depending on which command is first in the array list.