Ask about Drools, Business Rule (.brl file) and technical rule (.drl)
by Trong Hieu Tran
Hello Madam/ Sir
I'm Trong-Hieu, I'm developer at Clearpath LLC. I'm stuck with drools
guvnor and realy need your help please.
We developed web application with drools rules - technical rules (.drl).
Our project has a large of technical rule, one nice day, the customer would
like to transfer all the technical rules to business rules (.brl files). I
have searched on internet and can not find the right way to do.
Please help!
If you have any documents or reference links please show me.
I heard about Drools guvnor 6 that it allows the user use Guide Editor to
edit technical rule file (.drl), so if it is true, could I transform
business rule to technical rule in drools 6?
Please help me, I'm sorry to take your time.
Thank you,
Trong Hieu
11 years, 1 month
classloader issues
by Kiru Pakkirisamy
Hi all,
I am able to run the sample in Eclipse. But when I try to run it in my server, I get classloader issues.
Basically, I am trying to use Drools inside HBase coprocessor code. The coprocessor code is loaded from a jar on hdfs.
But the rules engine does not seem to be able to use its parent classloader to load the classes it needs.Instead if I put my code on a jar file and put it in the server classpath it works "ok" but still not good, as the class Drools wants is loaded by two different classloaders (one from hdfs) and the other one is using the jar files in the classpath of Hbase. Do I have add any other dir name so that the generated code classes can be picked up as well.
I am using .5.5 final.
Regards,
- kiru
Kiru Pakkirisamy | webcloudtech.wordpress.com
11 years, 1 month
Please help me on hibernate-meet-drools
by Hong Ju
Hi,
I would like Drools to save my POJO objects as Hibernate Entities so that I can see my POJO objects as db tables in my database.
I tried to make this work by searching on the net, but there is very limited example on this topic, my code does not have any error, but it does not save any tables in my db. I attached my project in this email, if someone can help me on this, this will be so great and make me move forward.
Thank you so much in advance,
Hong Lily Ju
Software Engineer
hong.ju(a)steward.org<mailto:derrick.smith@steward.org>
Steward Heath Care
[Description: cid:image001.png@01CD0DC1.C0D81BD0]
Office: 781-375-3034
Cell: 781-801-9313
11 years, 1 month
Pattern of usage question
by Laird Nelson
I have several questions about using Drools in a stateless Java EE
application.
(I've actually used it for years, but have always felt an impedance
mismatch and finally have a moment to ask about it. :-))
Like (I suspect) many people, I have a stateless session bean responsible
for some business logic with Drools in the mix. I'm looking to implement
its—say—doWork() method with a knowledge session under the covers.
What I'm curious about is: in a rules engine, facts are sort of expected to
stick around for a while (that's state; I know there are stateless
sessions, but those are kind of ephemeral). You grab a bunch of facts, and
over time they get inserted into the knowledge session, which sticks around
in some manner. Then, periodically, you fire all rules, and deal with the
consequences. Along comes another processing situation; you fire all
rules, and deal with the consequences again. And so on. The fact
maintenance seems stateful here while the rule processing is stateless.
How do people deploy stateless systems with this stateful concept at their
core? Which of the many possibilities is most commonly used?
Serialize/deserialize the session on each request (yuck)? Singleton beans
(yuck, I think)? Outboard drools server with RPC (also yuck, I think)?
Next, in a dynamic business application, it's often the case that single
rules need to be added to the knowledge base. Someone wants to add in, for
example, a new way of calculating fees. They don't—at a human level—want
to open up the catalog of 47,000 rules, add one, and then
re-install/re-deploy the thus-changed catalog of rules. They just—again,
at a human level—want to add a new rule. Is redeploying the catalog the
only way to go here, or is there a way that I've missed to incrementally
and programmatically add a rule to a KnowledgeBase?
More generally: in a stateless app, where do these concepts live? Where do
they *best* live, I should say?
(For completeness, I'm the author of the
drools-jca<https://code.google.com/p/drools-jca/>project, which
attempts to make Drools 5.x Java EE compatible by offloading
its filesystem and threading operations into a JCA resource adapter. I'm
not convinced that's the best place for it and with Drools 6 doing
different things with threads and with Java EE 7 relaxing its restrictions
on filesystem access I'm looking for better patterns.)
Thanks very much for reading; looking forward to the replies.
Best,
Laird
--
http://about.me/lairdnelson
11 years, 1 month
Are rule templates part of supported API?
by darrell.pittman
I am new to drools. The drools API doesn't include the
ExternalSpreadSheetCompiler. The on-line user guide (section 2.4.7 in the
expert guide) has an incorrect example for how to load a rule template and
data spreadsheet. It just shows loading the spreadsheet. No mention of
loading the rule template.
My question is: Is the ExternalSpreadSheetCompiler the correct way to load
in a rule template that uses a spreadsheet for it's data source? Note:
Eclipse gives a "Discouraged Access" warning when using the
ExternalSpreadSheetCompiler.
--
View this message in context: http://drools.46999.n3.nabble.com/Are-rule-templates-part-of-supported-AP...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month
Dynamically populate Rule-Flow Group?
by nzhu972
Hi,
I am using BRMS 5.3.1 and I have a scenario where I will have multiple
decision tables and for each decision table, a corresponding workflow
process is associated with it (scenario 1)
Scenario 1.
decision table: X, Y, Z
WorkFlow : A, B, C
Since there are no difference between the workflows except for the decision
table that the flow is referencing, I like to combine the workflows into one
single flow and dynamically populate the rule-flow group (see scenario 2)
Scenario 2.
decision table: X, Y, Z
WorkFlow : A
The rule-flow group will determine which set of decision table is relevant.
I have not seen examples where rule-flow group or any other attribute being
dynamically populated. Typically, they are assigned with a string during
declaration.
My question is :
is it possible to dynamic determine the value for rule-flow group during run
time and then assign it with a value?
Thanks in advance for any advice.
--
View this message in context: http://drools.46999.n3.nabble.com/Dynamically-populate-Rule-Flow-Group-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month
AfterEvaluatorDefinition NullPointer Exception in deserialized ksession
by Alexander Wolf
[Drools 5.5.0 Final]
I wrote a webserver that keeps StatefulKnowledgeSessions running in Stream mode. When the server is stopped, the sessions are serialized and stored in a database. When the server is restarted, the existing sessions are restored / deserialized.
Some time after recreating the session and inserting some events I get the following exception:
java.lang.NullPointerException: null
at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedLeft(AfterEvaluatorDefinition.java:351)
...
Apparently the exception seems to be related to a rule that uses temporal reasoning.
After getting it once, the session seems to be corrupt -> from now on every time I call ksession.insert(event) the same exception occurs.
When I serialize the session and attempt to deserialize it, I get a long stack trace --> I can not deserialize it anymore. (as apparently it is corrupted).
When I run the server with the same events/sessions without stopping (serialization/deserialization) the exception does not occur)
Can I do anything to prevent this behaviour? I thought maybe the "after" timer/trigger is somehow still active when I serialize the ksession.
I tried ksession.halt() before serialization, but with no effect.
Any ideas?
11 years, 1 month