Re: [rules-users] Error while adding rule package in 5.0.0M2 & 5.0.0M
by Jagathesh
I would really appreciate if someone could help me on this issue.
Thanks in advance,
Jagathesh
--- On Wed, 12/10/08, Jagathesh <jagamani(a)yahoo.com> wrote:
From: Jagathesh <jagamani(a)yahoo.com>
Subject: Re: [rules-users] Error while adding rule package in 5.0.0M2 & 5.0.0M
To: "Edson Tirelli" <tirelli(a)post.com>
Date: Wednesday, December 10, 2008, 11:18 AM
Thanks Edson.
I'm getting the following errors.
[[ERR 103] Line 55:59 no viable alternative at input 'getLevel' in rule "New Event - Level1" in pattern Event]
[[ERR 103] Line 176:64 no viable alternative at input '&&' in rule "Check For price"]
[[ERR 103] Line 176:79 no viable alternative at input 'format' in rule "Check For price" in pattern PriceDetail]
I didn't get any of those while I was using 4.0.7
Thanks,
Jagathesh
--- On Wed, 12/10/08, Edson Tirelli <tirelli(a)post.com> wrote:
From: Edson Tirelli <tirelli(a)post.com>
Subject: Re: [rules-users] Error while adding rule package in 5.0.0M2 & 5.0.0M
To: jagamani(a)yahoo.com, "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Wednesday, December 10, 2008, 9:40 AM
It seems the package you are trying to add is null... did you checked for parsing/compilation errors before trying to add the package into the rulebase?
PackageBuilder.getErrors()
[]s
Edson
2008/12/10 Jagathesh <jagamani(a)yahoo.com>
Hi,
When I pointed the rules from Drools 4.0.7 to Drools 5.0.0M2, I'm getting the following errors at runtime. I also tried Drools 5.0.0M3 (same error). The error occurs while adding a package.
Could someone help me? Do I've to do something differently for 5.0.0M2?
java.lang.NullPointerException
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:420)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:381)
Thanks,
Jagathesh
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com
15 years, 11 months
Collect CE requires a non-argument Exception..
by techy
I'm getting following exception when tried to insert an object(which has a
Long field and three List reference) retrieved from dao in rule conseqence.
>From stackTrace, I can see that it is thrown when drools is trying to create
an instance of List(which is not possible).
Please someone clarify this. Thanks in advance.
org.drools.spi.ConsequenceException: org.drools.RuntimeDroolsException:
Collect CE requires a non-argument constructor for the return type
at
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
Caused by: org.drools.RuntimeDroolsException: Collect CE requires a
non-argument constructor for the return type
at org.drools.rule.Collect.instantiateResultObject(Collect.java:69)
at org.drools.reteoo.CollectNode.assertTuple(CollectNode.java:111)
at
org.drools.reteoo.CompositeTupleSinkAdapter.propagateAssertTuple(CompositeTupleSinkAdapter.java:30)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:156)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:67)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:61)
at
Caused by: java.lang.InstantiationException: java.util.List
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.drools.rule.Collect.instantiateResultObject(Collect.java:64)
... 27 more
--
View this message in context: http://www.nabble.com/Collect-CE-requires-a-non-argument-Exception..-tp20...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 11 months
Could not find "from" in Guided Rule Editor
by Vithal Kuchibhotla
Hello,Is there a way to express this in Guided Rule Editor?Location($property: property)$items: Item() from $property.itemSetI could not find the "from" element in Guided Rule Editor.Thanks,Vithal
15 years, 11 months
Looking for a Drools Resource in the Bay Area
by Nick Heudecker
Hi,
I'm looking for a Drools resource in the Bay Area to help me determine if a
rules engine would benefit the application I'm building now. I've been
exploring Drools for the better part of two weeks and I'm honestly not
seeing the advantage of using it for my problem. I understand that's not
very long to be working with Drools to make a decision, which is why I'm
looking for an expert to talk to and possibly build the rules component if
that's the way to go.
If you're interested in discussing this, please let me know. Obviously, I'd
need you to sign a standard NDA.
Thanks for your time.
Regards,
Nick
15 years, 11 months
Understanding Rule Flows
by keithnielsen
I have a fairly involved rule flow (partial shown below) consisting of rule
flow groups. I am trying to understand
if the behavior I am seeing and my understanding of it are correct.
The flow executes as exepected the first pass through, objects are inserted
and the rules associated with the different nodes are executed. On the
second pass through the flow various nodes are triggered but none of the
ruleflow groups are activated/executed. My understanding of this is as
follows:
1) The only way to have these ruleflow groups fire/execute again is to
insert objects that cause a match or to fire all rules on the session again.
2) Constraints on split/join nodes are always evaluated and don't need to be
activated which is different than the constraints on a given rule
3) Rules that don't have any constraints, i.e. they are always true will
only execute once and will only execute with a call to fire all rules
Assuming my understanding of what is going on correct I have the following
questions:
Q. My particular use case is really screen flow/business process, and it
would be nice if I came to a node, that the rule was always evaluated, i.e.
currently rules that always evaluate to true aren't fired more than once.
For instance I have a node that simply instantiates a dialog and waits for
user input and I always want to instantiate that dialog when I come to that
node, regardless of the facts. Is there a way to achieve this without firing
all rules again?
Q. Is firing all rules within a rule flow a legitimate way of achieving the
desired affect?
Thanks
http://www.nabble.com/file/p20960565/RuleFlow.jpg
--
View this message in context: http://www.nabble.com/Understanding-Rule-Flows-tp20960565p20960565.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 11 months
Need some advices in using Guvnor in cluster environment
by Paul Sentosa
Dear mailing-list/forum reader,
this post is quite long, so thanks in advance for willing to read through this ;-)
I need to set up a test for using Guvnor in cluster.
I searched in the archive, and I know there are few threads regarding this.
But some are for me already too "high-level", bcs I didn't have many experiences on this, so I'd like to start from the beginning
Would be very thankful If you could share some advices on development strategies, based on following situation and questions:
Situation:
- several instances of one web-app (on several servers), say MyApp , with one MySQL server as back-end, should perform some value persisting into DB; each operation should get feedbacks, if this violates any rules defined using the BRMS.
- Rules will be updated rarely (approx. once a year)
1. As my understanding, Guvnor is just another web-app with DB on the back-end.
If MyApp has its DB already prefilled (because this is already running for quite some time) and according to the documentation, BRMS will create the tables the first time it is started if it's running again empty RDBMS, is it still possible to use this DB anyway? Is there any additional maintenance/handling required to do this?
2. Which one is in general the better (or correct) strategy:
- use one common DB for both MyApp and Guvnor or separate DBs (use another external RDBMS for Guvnor)?
- having as many instances of Guvnor as MyApp, or just having one single instance of this?
3. Having seen the documentation on integrating rules from Guvnor with app, I understand that there's need of using RuleAgent.
- RuleAgent (and Statefull/StatelessSession too) is still part of the "old" drools-core. Would it be later a problem to switch to the new APIs?
- I need to get the RuleClient from a stateless EJB; does this mean only StatelessSession is usable in this case?
4. How can I correctly implement the communication between MyApp and Guvnor?
I wouldn't like to fetching the rule base each time the persisting operation is performed.
- Which alternatives are there to avoid constantly communicate with Guvnor (especially if there is actually no rule-update happened), but still getting the most actual rule?
- Maybe kind of storing the rules in DB which is keep synchronized with Guvnor, and MyApp just fetch the rules from DB?
Again, any reply would be very appreciated.
Regards
Paul
15 years, 11 months
Problem with nested properties
by Olivier THIERRY
Hi,
We plan to use rules engine on a project because business rules will
often change and need to be written by business experts. We are
testing Drools 4.0.7 and are very interested with it, in particular
because of the ability to write DSL.
In our tests we wrote a rule that needs nested properties to compare
year part of two dates. But it doesn't work, it can't resolve nested
properties while we created the needed getter methods.
The rule is as following :
rule "CALCUL_RELICAT_CP"
salience 8
dialect "java"
no-loop
when
not VOCounter( code == "RELICAT_CP" )
$beginDate : RuleDate( name == "startDate")
$relicat : VOCounter (code == "SOLDE_CP_CUM", startDate.year ==
($beginDate.year + 1))
then
....
end
And the stack trace is as following :
org.drools.RuntimeDroolsException: Exception executing predicate eval(
startDate.year == ( $beginDate.year + 1 ) )
at org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:239)
at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:122)
at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:108)
at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:156)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
at t4.test.drools.TestRuleBase.loadLines(TestRuleBase.java:89)
at t4.test.drools.TestRuleBase.executeRuleWithDsl(TestRuleBase.java:116)
at t4.test.drools.Test1.testDsl(Test1.java:39)
Caused by: org.mvel.CompileException: unable to resolve property: year
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:289)
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:110)
at org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:26)
at org.mvel.ast.PropertyASTNode.initializePropertyNode(PropertyASTNode.java:70)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:24)
at org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
at org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:232)
... 46 more
Caused by: org.mvel.PropertyAccessException: unable to resolve property: year
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:383)
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:258)
... 56 more
We could make it work this way :
$relicat : VOCounter (code == "SOLDE_CP_CUM", $debut : startDate )
$startDate : RuleDate( name == "startDate" )
eval ($startDate.getYear() == $debut.getYear() + 1)
But we find this very complex for non business experts that are not
developers. And we find it too complex to write DSL for this.
It would be great if we could make it work using nested properties.
Are nested properties supported (I found in mailing list archives that
it was planned for 3.1 :
http://www.mail-archive.com/user@drools.codehaus.org/msg01331.html ) ?
Note I am a newbie with Drools and rules engine, so maybe there is a
better way to write it ?
Thanks in advance ;)
Olivier
15 years, 11 months