Rules and Ruleflow GroupS
by Welsh, Armand
A while back, I was looking to use Ruleflow-Groups and a process flow. Due to some issues in the code that affected the use of the process flow, I was unable to use them. I believe those issues have been worked out, and now I am looking into using them again.
One thing I am not clear on, is if I can have a single rule participate in more than one ruleflow group?
Regards,
Armand
13 years, 8 months
setting global variables in session : the Command interface VS the RuleContext. What is the difference ?
by bardelman
hi ,
i m new in drools, i m reading the Drools-JBoss-Rules-5.0-Developers-Guide
book in which i found a validation rule example on its chapter 3. In this
exemple, global variables were set into the session with two methods shown
in this code :
...
session = knowledgeBase.newStatelessKnowledgeSession();
session.setGlobal("reportFactory", reportFactory);
session.setGlobal("inquiryService", inquiryService);
...
and these variables qualified as immutables, were called from the
RuleContext
public static void error(RuleContext drools,
Object... context) {
KnowledgeRuntime knowledgeRuntime = drools
.getKnowledgeRuntime();
ValidationReport validationReport = (ValidationReport)
knowledgeRuntime.getGlobal("validationReport");
ReportFactory reportFactory = (ReportFactory)
knowledgeRuntime.getGlobal("reportFactory");
...
and for other variables(or facts ) the Command interface was used instead :
List<Command> commands = new ArrayList<Command>();
commands.add(CommandFactory.newSetGlobal(
"validationReport", report));
commands.add(CommandFactory
.newInsertElements(getFacts(customer)));
session.execute(CommandFactory
.newBatchExecution(commands));
i m looking for accuracy in understanding when and which to use each method.
thanks for help
--
View this message in context: http://drools.46999.n3.nabble.com/setting-global-variables-in-session-the...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Performace Issues drools
by sanal
Hi,
Iam trying to use Drools for implementing some of the business logic
in hospital billing senario.My senario is as given.Iam implementing the
concept of a packge. A package is a set of services or items are put
together based on some contions. Only the packge is to be charged not the
individal services or items in the package.
Eg: A Health Package is defined with name ExecutiveHealthCheckUp, which
have a condition say,quntity limit 2 for Laboratory tests.So if more than 2
test is ordered for a patient the 3rd ordered test should not be part of
package.
A ordered service is considered to be part of a package if the
packageChargeRecordId property of the service
Using Drools iam trying to find out each of the ordered services(
$orderedComponent) for the patient to be part of package or not. Each of
the ordered service have quntity field.So i need to sum the quntity field of
same services ordered multiple times which is already part of the same
package and compare it with the quntity limit defined in the package
definition.
If a service is part of package iam setting packageChargeRecordId property
of ordered service to the packageId.
For implementing the same i have 2 set of collecton.
1st collection has got list of ordered services for the
patient.($objOrderedComponents.getOrderedComponentList() )
2nd collection list of condition for the services to be part of package.
($packageDefinition.getPackageComponentList())
rule "Package Rate_21"
salience 65515
when
/*package defanition object */
$packageDefinition:PackageDefinition($packageId:packageId)
/*Gets the list of services ordered */
$orderedComponent:OrderedComponent($id1:componentKey,$qty:componentQty)
from $objOrderedComponents.getOrderedComponentList() and
/*trying to get the accumulated quantity for the services
which are already part of package */
$accumulatedQty:Number()
from accumulate (
$accQtyComponent:OrderedComponent(packageChargeRecordId==$packageId,componentKey==$id1,
$AccQty : componentQty) from
$objOrderedComponents.getOrderedComponentList(),sum($AccQty ) )
and
/*Comparing withe packakage definition rule */
$pkgComps:PackageComponent(componentKey==$id1,(quantityLmt
>=($qty+$accumulatedQty.intValue()))) from
$packageDefinition.getPackageComponentList()
then
/*setting the packagechargerecordId for the ordered services
which satisfies above conditions */
$orderedComponent.setPackageChargeRecordId($packageId);
/*The changes have happened in facts so updating in the working
memory so the rule get executed once again*/
modify ($objOrderedComponents){};
end
The problem i am facing here is of performance. This way of
implementation is taking much time compared to that of java code.If iam
not using accumulate function and iam executing the rules for each item
seperatly instead of passing entire collection,it is working much better.
Can anbody suggest a better way to implement it using drools.
Regards
Sanal.P
--
View this message in context: http://drools.46999.n3.nabble.com/Performace-Issues-drools-tp3902270p3902...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Explanation of a decision
by Maxim Kolchin
Hi,
I'm working on expert system, automating one of the stages of optical
design.
Now, we're testing the system and we need a function, eхplaining a decision
of the system: which rules has been fired, why they has been fired and so
on. And I'm looking for a way to implement this feature.
Has someone had an experience in implementing this kind of features? Or
does someone know how it can be implemented?
Thank you,
Maxim Kolchin
Laboratory of Intellectual Systems,
National Research University ITMO,
http://en.ifmo.ru
13 years, 8 months
Trying to make drools-debugging (Eclipse) work in "FIT for rules"
by ingo_mytoys
Hi folks,
I'm happy that I recently discovered both the Eclipse debugging views for
Drools (working memory, agenda) and the FIT for rules framework. Since our
development project itself can't be tested as Drools-Application I'd like to
use FIT for acceptance-tests and debugging. Might be a smooth solution.
However, I don't manage to make drl-file-breakpoint-debugging work in the
fit-project, being run as Drools-application. It just won't stop the program
flow. With the parallelly installed drools-example-project however
everything works just fine.
Do you have an idea, what I might have to change in the project settings or
the code to get breakpoints work in the fit-project?
Facts for both, drools-examples and fit:
Eclipse Indigo
Drools 5.3.Final
Eclipse-Tools from Drools 5.4.BETA (because audit-view has a bug in 5.3)
Breakpoint is set only at then-part of rules :-)
Thanks a lot for your help!
Cu,
Ingo
--
View this message in context: http://drools.46999.n3.nabble.com/Trying-to-make-drools-debugging-Eclipse...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
setting global variables in session : the Command interface VS the RuleContext. What is the difference ?
by Ahmed Feki
hi ,
i m new in drools, i m reading the Drools-JBoss-Rules-5.0-Developers-Guide
book in which i found a validation rule example on its chapter 3. In this
exemple, global variables were set into the session with two methods shown
in this code :
...
session = knowledgeBase.newStatelessKnowledgeSession();
session.setGlobal("reportFactory", reportFactory);
session.setGlobal("inquiryService", inquiryService);
...
and these variables qualified as immutables, were called from the
RuleContext
public static void error(RuleContext drools,
Object... context) {
KnowledgeRuntime knowledgeRuntime = drools
.getKnowledgeRuntime();
ValidationReport validationReport = (ValidationReport)
knowledgeRuntime.getGlobal("validationReport");
ReportFactory reportFactory = (ReportFactory)
knowledgeRuntime.getGlobal("reportFactory");
...
and for other variables(or facts ) the Command interface was used instead :
List<Command> commands = new ArrayList<Command>();
commands.add(CommandFactory.newSetGlobal(
"validationReport", report));
commands.add(CommandFactory
.newInsertElements(getFacts(customer)));
session.execute(CommandFactory
.newBatchExecution(commands));
i m looking for accuracy in understanding when and which to use each
method.
13 years, 8 months
Drools Performance and Maintanability
by dollanitri
Hello,
Recently i started playing out with Drools Guvnor GUI and created couple of
rules based on DecisionTable
GUI Editor and also ruleflows in eclipse.
Then integrated Drools with Java Custom Web Application and tried out
executing rules on front end by changing rules on the drools guvnor at run
time. All seems to be working fine as per expected.
But i have couple questions would like to ask related to performance and
maintainability of the drools.
Questions:
1) does drools guvnor provides any option to make revisions for the decision
tables ?
(Eg. If more than single developer working on the same decisiontable and
making modifications to it then
it should allow to merge all the changes into main one.....)
2) how to measure performance of the drools to make it work and available
for the large rule datasets?
3) There are options to store data in a different formats like repository
(default one), Oracle, mysql.....etc
which one is better if i want to make my data backup very easily and import
it back whenever i need ?
4) is it drools is good one to replace with Yasu?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Performance-and-Maintanability-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Unable to view drls in guvnor
by arup
Hi all,
I have my guvnor deployed in WAS. Now i added the POJO model and drls from
RAD(rational app developer) to my guvnor. I'm able to fire the rules from
guvnor by using url for package source. But the problem is i'm not able to
view any rules inside technical rule asset. but if i open the url for
package source i can view the imports and rules inside them. Any idea about
why this is happening?
Thanks a lot in advance... :) :) :)
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-view-drls-in-guvnor-tp3919043...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months