Drools 5.0 -> 5.2 Migration Issue
by Steven Waldren
I am working to migrate my project from 5.0 to 5.2.0 Final. I am getting an error that I cannot figure out how to fix.
I get the error stack trace below my email signature. The only thing the consequence does is insert an object. This rule worked well in 5.0, and some of the early 5.2.0-snapshot builds. When I comment out the rule, I get the same error for a similar rule.
The rule:
rule "ccr - Person"
when
ActorType.Person($g:gender != null)
then
insert($g);
end
The documentation does not say this is an incorrect syntax. Any help would be appreciated.
Best,
Steven
--
Steven E. Waldren, MD MS
Co-founder, Open Health Data
swaldren(a)openhealthdata.com
validateTest(org.openhealthdata.validator.ValidatorManagerTest) Time elapsed: 11.699 sec <<< ERROR!
org.drools.runtime.rule.ConsequenceException: rule: ccr - Person
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:916)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
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)
at org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:158)
at org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:108)
at org.openhealthdata.validator.ValidatorManagerTest.validateTest(ValidatorManagerTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: org.drools.RuntimeDroolsException: Exception executing predicate
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:119)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:113)
at org.astm.ccr.rules.core.Rule_ccr___Person_0.defaultConsequence(Rule_ccr___Person_0.java:7)
at org.astm.ccr.rules.core.Rule_ccr___Person_0DefaultConsequenceInvoker.evaluate(Rule_ccr___Person_0DefaultConsequenceInvoker.java:27)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)
... 37 more
Caused by: java.lang.NullPointerException
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:104)
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 58 more
13 years, 5 months
Any high volume trading examples?
by Nigel R Murray
Hello all. I'm at the point where I need to pick the brains of those of you
who have spent significant time with Drools I am just in the process of
trying to decide if Drools is the right choice for a high volume trading
application. It would be best if there were some simple examples out there
of how to create this type of app in Drools but I suspect they don't exist.
(The reason I even considered moving to a CEP framework is that I know that
Streambase claims to be ideal for this type of application. But they are
way out of our budget.)
The application we are developing is highly modular and multi-threaded with
many self-contained operations/modules that can be performed in parallel on
incoming events. Each threaded module would take as its inputs either the
input stream event or the outputs some other modules. Eventually the
various outputs would be combined into an output trade request event.
I can envisage how to create such an application directly in Java using,
say, the Observer pattern (where each of the modules subscribes to its
desired inputs) but it's difficult to get this to run multi-threaded and we
are going to need to be able to use all the processors and cores available
on the executing server. It's also a clumsy way to implement what should be
an elegant architecture. If I understand the Drools paradigm correctly,
Drools should take care of multi-threading and timestamp synchronization
automatically. This is the appeal.
I fear this is coming out a little like gobbledegook but before I spend much
more time on understanding how Drools works, I thought some of you experts
might have some simple words of advice.
Any comments or suggestions or am I way off base here?
Thanks!
Nigel
--
View this message in context: http://drools.46999.n3.nabble.com/Any-high-volume-trading-examples-tp3118...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
MUTEX, mutual exclusion in Drools?
by itchupe
Hello there
I am new to all drools...
How can I 'mutex' in drools? Or could you suggest a better concept for that?
(i mean, when two rules would fire : rule1 and rule2 in agenda
the mutex is checked and : mutex for this case is defined, rule1
= higher, rule2 = lower prio
only the one rule with higher priority will be executed)
Cheers. Please let me know if my question is understandable...
--
View this message in context: http://drools.46999.n3.nabble.com/MUTEX-mutual-exclusion-in-Drools-tp3117...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Drools & jBPM team hiring soon
by Mark Proctor
http://blog.athico.com/2011/06/drools-jbpm-team-hiring-soon.html
I'll post more details when I have them, but I thought I'd let people
know we'll be hiring multiple positions over the next 6 to 9 months for
Drools and jBPM.
We'll have an immediate position for a very senior Drools programmer
extraordinaire. We'll be looking for someone able to help us build the
next generation high performance reasoning engine.
So if you think in ontologies, eat Prolog for breakfast, are fluent in
Haskell, able to give a detailed critique of FIPA and explain truth
maintenance and defeasible reasoning while also being able to design and
build scalable parallel, concurrent and distributed java systems – send
me an email :) mproctor at codehaus d0t org
13 years, 5 months
Accessing List<String> with mvel in condition
by esstrata
Hi,
I've tried several options but none working so I welcome any help.
* I'm using Drools 5.1.1.
* I succesfully insert several List<String> into Working Memory and I'm able
to printout them with a debug rule.
* The problem is, when I try to access a position in a list I get no match
even though I have values that should match. Here is the relevant code:
rule "B Number has characters other than numbers"
dialect "mvel"
when
$traffic_row : List(this[5] matches "[^0-9]")
then
System.out.println("row found" + $traffic_row)
end
Thank you in advance
--
View this message in context: http://drools.46999.n3.nabble.com/Accessing-List-String-with-mvel-in-cond...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Drools implementation problem
by dan.dobrescu
Hello,
I'm trying to implement Drools in our project, but I really don't know which
method to adopt. First of all, our project is about creating marketing
campaigns for mobile network operators. So, we've got a Web UI where we let
the user define his own rules for the campaign.. Now.. here's my problem.
Should i try to translate everything in the UI in a custom drl with a custom
agenda-name (because there can be many custum campaigns with different
flows), or should I create an object with different properties which should
reflect the chosen options in the web-ui and then use it in my rules to
create the behaviour?
If I should go with the first option, how can I store it? Should I store the
drl in Guvnor(but the models my change from time to time.. not the
attributes used in the rules, other attributes.. and I can't import several
jars from an url to have access to the models, can I?) or in DB, and the
dynamically add the rules at run-time?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-implementation-problem-tp3113482...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Re: [rules-users] Reuse of rule
by Küng Sabrina
Yes, sorry. I will try the extends and get back with a clearer question.
Thanks.
________________________________
From: Küng Sabrina
Sent: Mittwoch 1 Jun 2011 13:22
To: 'rules-users(a)lists.jboss.org'
Subject: RE: Reuse of rule
Thanks for your input. I am looking forward to the plugin.
How can I use a rule in the if-part (or as precondition) of another rule? Is that possible without using a ruleflow?
________________________________
From: Küng Sabrina
Sent: Montag 30 Mai 2011 13:52
To: 'rules-users(a)lists.jboss.org'
Subject: Reuse of rule
Hello
How can I write a rule, that can be used in several other packages resp. rulesets without copying the code?
13 years, 5 months
newbie question: forming event pairs
by Wouter De Borger
Hi all,
I'm new to drools and I have the following problem:
A stream of Start and Stop events comes into the engine.
The start and stop events should be paired and transformed into ranged
events.
Each start event should be paired to the first next stop event that is not
part of a pair already, with precedence for the last start event that came
in.
The problem is comparable to what a parser would do to match nested braces.
A sequence of the form
1: Start
2: Start
3: Start
4: End
5: Start
6: End
7: End
8: End
should form the following pairs
3-4
5-6
2-7
1-8
I checked the documentation but I still have two problems:
1. how can I find the next stop event (or previous start)
2. how can I make sure the pairs are formed innermost first?
Thanks in advance,
Wouter
13 years, 5 months
Building
by హరీష్ చౌదరి కూకట్ల
Hello EveryOne,
I am new to drools and I have couple of questions.
1. How to build group of .drl files as a package and load it into the
session.
2. Is there a way to see what rules are loaded into the session
programatically
Thank you very much,
Harish Kukatla.
13 years, 5 months