kcontext.getKnowledgeRuntime().getAgenda().getAgendaGroup( "B to D" ).setFocus();
a low salience rule would set
the AG for the Spartan group and so on.
You can change the focus on the RHS of a rule as well, using the API.
Starting in the default agenda group, a low salience rule would set
the AG for the Spartan group and so on.
Notice that any attribute can be set in front of or in between rules to
become effective in successive rules. This should also work in XLS,
except that you may have to create three files for your three groups.
(The XLS parser isn't very intelligent, at least wasn't last time I was
looking.)
-W
On 04/06/2013, Ramon Buckland <ramon@thebuckland.com> wrote: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
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users