How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
13 years, 4 months
drools - packaging creates a full snapshot...why?
by jcrowe
I have been using drools for almost a year now and build several packages a
day. Things are starting to slow down a bit and I've started to wonder if
it is because of all the workspace copies and the jcr overhead of them. I
have implemented a deletion of old workspace copies but this made me wonder
why drools is doing (in RulesRepository):
this.session.getWorkspace().copy( source, newName );
its not like i need a copy, once the package is built, it doesn't seem to
'rebuild it' from this snapshot. I have no way of "recovering to" this
snapshot.
Anyone can help me with the reason behind the copy (perhaps why I shouldn't
just delete this copy? I'm sure there are side-effects of this I'm not
thinking of, etc., etc.,)
Any feedback is appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/drools-packaging-creates-a-full-snapsho...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Common Practices for warning or debug rules/messages
by wendy
Hi,
I'm working on a system that has a large number of rules and we are
getting to the point where we think it would be useful to have some 'debug'
or 'warning' type rules (for lack of a better word). The warning rules
would be rules that would signal to us that something is wrong with the
underlying data and would require someone to go in and fix something. I was
wondering if there are some standard practice as to how to write, maintain,
format... these rules. I can think of a couple of ways to do this but I
would like the communities opinion. We would also like the ability to turn
on/off these debug or warning rules easily while the rest of the system
keeps on processing.
Thank you,
Wendy
--
View this message in context: http://drools.46999.n3.nabble.com/Common-Practices-for-warning-or-debug-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
by Steven Waldren
Wolfgang,
The ActorType definition is here: https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/j...
The point of this rule (and the other rules in this package) is to "walk" through a very complex object graph and insert the objects into working memory.
I do not use the rule attribute "dialect". The drl in question is here: https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/r...
I tried to create a simple project that caused the same error, but I create a Class with inner classes similar to ActorType and write a rule like the one in question, but it does not cause the error.
Thanks,
Steven
--
Steven E. Waldren, MD MS
Co-founder, Open Health Data
On Jun 29, 2011, at 2:49 AM, rules-users-request(a)lists.jboss.org wrote:
> Date: Wed, 29 Jun 2011 09:49:10 +0200
> From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
> Subject: Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <BANLkTin04ytQVP6T3tdR6j8ZjUKCO9Rvyw(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Please provide the type declaration for ActorType.Person, field gender and
> typicial examples how gender fields are used in other rules. Ideally, if you
> could reduce your rule set to this simple rule and one other rule, still
> causeing the same problem.
>
> Also, do you use "dialect 'mvel'"?
>
> -W
13 years, 5 months
Date arithmetic in when part
by rouvas@mm.di.uoa.gr
Hi list,
I feel this should be an elementary question but unfortunately I haven't
been able to find a solution.
I would like to perform date arithmetic in the when part of a rule.
For example, I would like to express something like:
rule "Date compare rule"
dialect "mvel"
when
a : A()
b : B( a.creationDate <= b.creationDate after 3 months)
then
...
end
Apart from using eval()'s is there any other way to express these types of
comparisons?
Thank you for your time,
-Stathis
13 years, 5 months
activation dependent of rule order in drl file in 5.2.0.Final?
by Florian Beckmann
Hi,
because of https://issues.jboss.org/browse/JBRULES-2942 i just migrated our
(maven) project to 5.2.0.Final - we depend on salience in some of our rules.
However, after the salience issue was gone I'm facing a new problem in several
test cases:
Rules in previously (drools 5.1.1) working rule files don't get activated
anymore when I insert facts - none at all.
When moving the rule expected to fire (see "rule 4" in attached file) to the
first position in the drl file then suddenly several rules get activated and the
expected rule fires.
This shouldn't be the case, shouldn't it? Or do I miss something obvious here?
Could a corrupt file somehow cause this?
I attachached the rule file which causes the problem (I needed to obfuscate
some names, sry). It is quite simple.
I experienced a similar issue (again since 5.2.0.Final) with rules generated
from templates, where I had to change the constraints order in the templates'
LHS for then generated rules to get activated at all.
First I would like to know if my statement that the rule position in the drl
file shouldn't influence the activation (I don't mean firing or order of
activations) of a rule at all, is correct.
I don't use agenda groups.
And second if someone experienced similar issues.
I will try to build a test case which hopefully can reproduce this as soon as
possible.
Florian
13 years, 5 months
NullPointerException in RightTupleIndexHashTable.remove()
by Weiss, Wolfgang
Hi all!
I encountered that null pointer exceptions occur when retracting an object from the working memory. Sometimes the problem occurs sooner sometimes later but it certainly happens. I think it also depends on the workload on the machine. Sometimes the NPE is thrown in 'LeftTupleIndexHashTable' but mainly in 'RightTupleIndexHashTable'. After the exception is thrown, the object to retract is still in the working memory. When I remove the line 'retract($obj)' in my rule, I don't get an exception.
The problem occurs mainly in this rule, but also in other rules:
rule "remove a cross talk"
agenda-group "evaluation"
activation-group "ag-crossTalk"
lock-on-active true
salience 40
when
$ctf : CrossTalkFact($persID : uniquePersonID, $ctfTimestamp : timestamp)
$pers : AnalysisCue(cueType == AnalysisCue.ACTION_STOP_TALKING, uniquePersonID == $persID, timestamp > $ctfTimestamp) from entry-point "LowLevelCueStream"
then
retract($ctf); //the suspicious line
//... do some other things
end
My configuration:
drools.dialect.java.compiler = JANINO
EventProcessingOption = STREAM
I was able to reproduce the problem with following versions:
5.1.1
5.2.0.M1
5.2.0.CR1
Stack trace from the version: 5.2.0.CR1
org.drools.runtime.rule.ConsequenceException: rule: remove a cross talk
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:915)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:844)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1055)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...
Caused by: java.lang.NullPointerException
at org.drools.core.util.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:351)
at org.drools.reteoo.NotNode.retractRightTuple(NotNode.java:178)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:229)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:529)
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:226)
at eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0.defaultConsequence(Unknown Source)
at eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0DefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:905)
... 31 more
Sometimes the exception occurs in the LeftTupleIndexHashTable:
org.drools.runtime.rule.ConsequenceException: rule: remove a cross talk
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:915)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:844)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1055)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...
Caused by: java.lang.NullPointerException
at org.drools.core.util.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:275)
at org.drools.reteoo.NotNode.retractLeftTuple(NotNode.java:231)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:212)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:86)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:210)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:212)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractRightTuple(SingleLeftTupleSinkAdapter.java:119)
at org.drools.reteoo.JoinNode.retractRightTuple(JoinNode.java:192)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:229)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:529)
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:226)
at eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0.defaultConsequence(Unknown Source)
at eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0DefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:905)
... 31 more
Any help is appreciated.
Best regards,
Wolfgang
13 years, 5 months
Guvnor guided editor problem - "add more options"
by capeja
Hi all, I'm completely new to Drools and Guvnor and I'm following the "JBoss
Drools Business Rules" book's instructions for getting familiar with Drools.
When adding action to rule I cannot get the "add more options" feature
working in Guided Editor - "U->" like icon is missing and the "pen" icon
does not work either. For those who have the book, I'm talking about the
example in page 102. The data model is exactly as described in the sample
case. Any idea of what's the problem?
BR,
Pekka
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-guided-editor-problem-add-more-o...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months