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
Removing rule (DRL) from resource throwing NullPointerException...
by prashant.badhe
Hi,
I am using Drools Kbase stateful sessions and using "changeset.xml" file to
dynamically load resources (DRL files) from a folder.
The KnowledgeAgent configuration property 'drools.agent.newInstance' is set
to false.
And the 'drools.resource.scanner.interval' property is set to 1.
As I am using Spring, these properties are passed-in to the agent from
spring-beans.xml.
Now, when I start tomcat, everything works fine (some rules also get fired),
But when I remove a DRL rule from my resource folder following exception is
thrown:
Exception in thread "Thread-8" java.lang.NullPointerException
at
org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter.cleanUp(RuleTerminalNode.java:507)
at org.drools.reteoo.BetaNode.doRemove(BetaNode.java:253)
at org.drools.common.BaseNode.remove(BaseNode.java:109)
at
org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:411)
at org.drools.common.BaseNode.remove(BaseNode.java:109)
at
org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:237)
at
org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:432)
at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:831)
at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:809)
at
org.drools.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:206)
at
org.drools.agent.impl.KnowledgeAgentImpl.removeKnowledgeDefinitionFromBase(KnowledgeAgentImpl.java:842)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:763)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:586)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
at
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1106)
at java.lang.Thread.run(Thread.java:662)
Is there anything more that needs to be set for 'changeset' to work for
add/update/remove of resources?
FYI - I am using Drools 5.1.1
Thanks,
Prashant
--
View this message in context: http://drools.46999.n3.nabble.com/Removing-rule-DRL-from-resource-throwin...
Sent from the Drools: User forum mailing list archive at Nabble.com.
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