Hello folk.
I am trying to work out the best way to use drools for an application where
I have :
- A domain of @30 fairly complex policy rules each of which has a
Boolean outcome (Fired or Not)
- A domain of @100 "audiences" who apply different subsets of the
policy rules and make their own "Decision" based on the policies that have
fired.
I am very keen:
a) NOT to duplicate the Policy rules themselves
b) To make mapping of audience & policy to decision as simple as
possible - ideally through a table
c) To keep all decision data in the same repository for uniform
version control
My thinking is that I'd have a flow, first execute the policy rules as one
group and save results in working memory and then use these results in an
audience-specific way.
I get stuck at this second step as I cannot find a compact way to handle the
mapping of Audience/Policy to Decision. Logically what I need to achieve is
as follows. E.g. for audience 1, if policy 1 fires, we decide to refer. (If
more than one has fired, decline trumps refer).
Audience policy1 policy2 policy3 policy4 ...
audience1 refer refer decline (n/a)
audience2 (n/a) decline decline (n/a)
...
Clearly I could do this outside Guvnor but then the UI would be outside
Guvnor & the data would be separated from the drools jcr repo.
I hoped to achieve a rule table as follows (fairly compact) but this would
require DISJUNCTION between cols
Audience policy1 policy2 policy3 policy4 Action
audience1 true true refer
audience1 true decline
audience2 true true decline
If I broke out a rule for every combination of audience and policy this
would get very long.
Any smart ideas? Thanks in advance to anyone who spares the time to think on
this one!
Rich
PS. I attempted to post this about 3 hours ago but believe I made a mistake.
Sorry if it comes through as a duplicate
Show replies by date