I have to port some stored procedures into Drools. Since stored procedures follow an imperative programming model, I am finding it tricky to convert them into Drools rules. For example, I could have a series of case statements like this:
case
when <condition 1> then <action 1>
when <condition 2> then <action 2>
when <condition 3> then <action 3>
end
Because there is an ordering implied in the evaluation above, i.e. evaluate condition 1 first, then condition 2, and then condition 3 I am finding it difficult to translate that into Drools. In Drools, I just write the rules without order specified. How can I achieve the ordering implied by the above SQL into Drools rules? Do I have to create a JPBM process and have a rule task for each of the conditions in the above SQL?