[rules-users] Separate selectable drl files in drools kbase.. Or agenda groups

Ramon Buckland ramon at thebuckland.com
Tue Jun 4 17:57:25 EDT 2013


Hi,

I am using a Stateless Knowledge session backed behind a web rest api.
The rest api is provided by spring Mvc, so I have a stateless ksession
injected in.

As it is stateless, I have found it difficult to use agenda groups to
meet my need. And have a question to how I set this up.

My task.
In short, I have 10 or so set up rules (init rules), then a 300 odd
(work) rules, then I need to fire a few (5) (finalisation) rules.

They need to be processed in that order. If I were using stateful I
see how an agenda group solves that need.. In the calling java that is
nice. setFocus().. But stateless blocks that api.

So I have attempted with auto-focus..

In the DRL (from XLS) however getting the agenda group settings right
has been a small 'mare. Suffice to say I haven't got it working.

My options:
 1. get agenda groups working.
2. split the three groups into 3 DRL files. and execute in sequence
each one using a different ksession for each.

--- on 1.

How would I construct the flow.. .. Do I use three separate auto focus
rules , one for each a.group  and set a salience ( I don think
salience helps here ) ? How do I guarantee to stack the focus using
auto-focus to follow my ordering?

-- on 2.
Can I create a separate ksession for each DRL file (injecting them in
from spring).

-- 
Thoughts ? Am I solving right ?

Many thanks. Ramon


More information about the rules-users mailing list