1
votes

I have been using a spreadsheet decision table based on drools. My requirement is such that, I need to trigger multiple rules specified in a single execution. I have the decision table image attached here.

To explain my question, If the conditions in my input are such that the first three parameters are TRUE|FALSE|FALSE (which meets the first rule criteria) followed by the last two parameters having values which meet the last three rule criteria.

So, if the input conditions are TRUE|FALSE|FALSE|TRUE|FALSE|, Is there any way where I can trigger The first rule and the second rule together and return the result in a list, which will be in this case, APPROVERTWO and APPROVERFOUR for the first action.

-------------------------------------------------------------------------------------------------------------------------------------------
Role    |ConditionOne   |   ConditionTwo    |   ConditionThree  |conditionFour  |conditionFive  |   Approver one        |   Approver two
-------------------------------------------------------------------------------------------------------------------------------------------
ROLEONE |   TRUE        |   FALSE           |   FALSE           |   FALSE       |   TRUE        |   APPROVERTWO         |   APPROVER SEVEN
ROLEONE |               |                   |                   |   TRUE        |   FALSE       |   APPROVERFOUR        |   -
ROLEONE |               |                   |                   |   TRUE        |   TRUE        |   APPROVERFIVE        |   -
ROLEONE |               |                   |                   |   FALSE       |   FALSE       |   APPROVERSIX         |   -
---------------------------------------------------------------------------------------------------------------------------------------------
1

1 Answers

1
votes

The straightforward solution is to modify the action in column "Approver one" so that it returns APPROVERTWO and APPROVERFOUR in the result list.

It's also possible that your application logic doesn't fit the schema of Drools' spreadsheet decision tables, (or vice versa, which amounts to the same thing). What you describe can be easily expressed as a rule:

rule
when
  Fact( role == "ROLEONE",
        conditionOne == true, conditionTwo == false, conditionThree == FALSE,
        conditionFour != conditionFive )
then
  return APPROVERTWO and APPROVERFOUR in a list
end

The logic you express in the spreadsheet is based on individual distinct values for the attributes. Clearly, the rule resulting from the first row will never fire if #2 fires, or the other way round.

There may be other options, but one can't propose a general approach based on a single case.