Instead of creating 3 Knowledge bases you can have one KnowledgeBase with
all three decision tables and then each decision table will have a
"Salience" to control the priority of execution. DT1 has highest Salience
and DT3 has lowest value.
When you upload these DT into Drools BRMS you will have one binary package
for all these three DTs even though you define different packages for each
one of those DTs. Is that the case ?
________________________________
From: HonorGod <jagadeesh.motamarri(a)barclayscapital.com>
To: rules-users(a)lists.jboss.org
Sent: Fri, January 15, 2010 11:47:21 AM
Subject: [rules-users] Is this possible in Guvnor?
Hi,
I have a single fact model with 5 [a1, a2,a3, a4, and a5] different
attributes. I have 3 decision tables in the following fashion
Decision Table 1
---------------------------------------------
condition | condition | condition | Action |
---------------------------------------------
a1 | a2 | a3 | a4 = a1+a3|
----------------------------------------------
Once I have the value of a4, I need to hit different set of rules which
are
stored in second decision table
Decision Table 2
---------------------------------------------
condition | condition | condition | Action |
---------------------------------------------
a1 | a2 | a4 | a5 = a4 |
----------------------------------------------
Once I have the value of a5, I need to hit different set of rules which
are
store in third decision table
Decision Table 3
------------------------------------------------------------------------
condition | condition | condition | condition | condition | Action
|
-------------------------------------------------------------------------
a1 | a2 | a3 | a4 | a5 |
computeValue() |
------------------------------------------------------------------------
I don't have any problem when I load the rules into individual
KnowledgeBase
and fire the rules one after the other as follows -
<code>
// apply rules from decision table 1
StatefulKnowledgeSession kSession =
knowledgeBase1.newStatefulKnowledgeSession() ;
kSession.insert(caEventDO);
kSession.fireAllRules();
// apply rules from decision table 2
kSession = knowledgeBase2.newStatefulKnowledgeSession() ;
kSession.insert(caEventDO);
kSession.fireAllRules();
// apply rules from decision table 3
kSession = knowledgeBase3.newStatefulKnowledgeSession() ;
kSession.insert(caEventDO);
kSession.fireAllRules();
kSession.dispose() ;
</code>
But when I upload the decision tables into Guvnor and use the package /
drl
from the package snapshot my second set of rules are not fired at all.
How do I resolve this issue?
Please help.
Thanks
--
View this message in context:
http://n3.nabble.com/Is-this-possible-in-Guvnor-tp122132p122132.html
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users