Proper termination of a CommandService
by Michal Bali
Hello,
Let's say I have some implementation of a CommandService (for example
StatefulSessionCommandService). After I finish working with this
CommandService, I want to correctly 'destroy' this object. Since it contains
a stateful rule session, I believe this session needs to be disposed. What
is the right way to do it?
I was thinking about implementing a DisposeCommand that will simply call
session.dispose() in its execute method. Is this a valid solution?
Best Regards,
Michal
15 years, 12 months
design question - how to modell this in DRl
by Thorsten Trägenap
Hi,
I´m totally new to Drools and DRL.
I want / (better words I must, because of my diploma thesis) to connect
a couple of different software-applictions using Drools as logical
middleware.
First i want to translate some kind -like the following ones- of natural
rules into DRL and I have no idea how to do this in correct way.
Facts are
- Order
Order contain information about "creationDate" and "customerBelongingTo"
- Customer
Customer contains information (=days as int value) about
"allowedTimePeriodWithoutNewIncomingOrder", on expiry of this time
period this customer should me marked to inform a "Person"
- Persons
There are living persons(maybe) which are interested in
"customersWithNoNewIncomingOrder". The should be informed by mail, etc.
Please any idea to do this in best DRL way?
Thanks
Thorsten Trägenap
15 years, 12 months
Implementing a XOR Group between 2 rules with Drools 3 (legacy...)
by Maxim Veksler
Hello,
It seems that Drools 3 performs better for us (at least for now...)
then Drools 4. Drools 5 was not yet tested.
I'm wondering what is the most efficient method of implementing Drools
4 activation-group[1] feature using Drools 3 ?
In my system, in order to complete the match session I'm using a
combination of 2 rules one (and only one!) of them must pass so that
the match will be successful. I would like to use a XOR between them
and give higher salience to the first rule which is a light weight
version of the second. My motivation is keep drools from evaluating
the second more complex structure of the "heavy" rule as fast as
possible.
So, to summarize - How would you guys recommend implementing the XOR
structure between 2 Multiplicative inverse rules ?
Thank you,
Maxim.
[1] http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.h...
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
15 years, 12 months
NullPointerException with float field
by techy
I have rule that logical comparison with two Float fields(like price <
bidPrice || price >= bidPrice ). I get following exception if one of field
is null. Is this expected behaviour? Please clarify. Thanks
Caused by: java.lang.NullPointerException
at
org.drools.base.extractors.BaseObjectClassFieldExtractor.getFloatValue(BaseObjectClassFieldExtractor.java:84)
at
org.drools.base.ClassFieldExtractor.getFloatValue(ClassFieldExtractor.java:191)
at
org.drools.base.evaluators.FloatFactory$FloatLessEvaluator.evaluate(FloatFactory.java:250)
at
org.drools.rule.VariableRestriction.isAllowed(VariableRestriction.java:73)
at org.drools.rule.VariableConstraint.isAllowed(VariableConstraint.java:67)
at org.drools.rule.AndConstraint.isAllowed(AndConstraint.java:47)
at org.drools.rule.OrConstraint.isAllowed(OrConstraint.java:50)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
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.update(AbstractWorkingMemory.java:1287)
at
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:103)
--
View this message in context: http://www.nabble.com/NullPointerException-with-float-field-tp20740799p20...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 12 months
Rete Tree does not load in the plugin
by Anil
I don't know whether this is the right place for this question.
The Rete Tree view of the Eclipse drl editor does fails for the example
drl fild, with "Rete Tree Build Error".
I tried the suggestion given in
http://www.nabble.com/Problems-with-drools-4.0.7-examples-tp18091849p1809...
as well, but does not work.
Did any one experienced the same thing ...
I have Version: 2.0.0.Beta1-R200810311334 of Jboss Tools
on Eclipse,
Version: 3.4.1
Build id: M20080911-1700
Stack Trace:
java.lang.Exception: Unable to parse rules to show RETE view!
at
org.drools.eclipse.editors.rete.ReteViewer.loadReteModel(ReteViewer.java:147)
at org.drools.eclipse.editors.DRLRuleEditor2$3.run(DRLRuleEditor2.java:244)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
org.drools.RuntimeDroolsException: Unable to resolve class
'com.sample.DroolsTest$Message'
at
org.drools.base.ClassFieldAccessorCache.getClass(ClassFieldAccessorCache.java:282)
at
org.drools.base.ClassFieldAccessorCache.getClassObjectType(ClassFieldAccessorCache.java:206)
at
org.drools.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:309)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:463)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:381)
at
org.drools.eclipse.editors.rete.ReteViewer.getRuleBase(ReteViewer.java:115)
at
org.drools.eclipse.editors.rete.ReteViewer.loadReteModel(ReteViewer.java:145)
at org.drools.eclipse.editors.DRLRuleEditor2$3.run(DRLRuleEditor2.java:244)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
java.lang.reflect.InvocationTargetException
at org.drools.eclipse.editors.DRLRuleEditor2$3.run(DRLRuleEditor2.java:251)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.Exception: Unable to parse rules to show RETE view!
at
org.drools.eclipse.editors.rete.ReteViewer.loadReteModel(ReteViewer.java:147)
at org.drools.eclipse.editors.DRLRuleEditor2$3.run(DRLRuleEditor2.java:244)
... 1 more
Root exception:
java.lang.Exception: Unable to parse rules to show RETE view!
at
org.drools.eclipse.editors.rete.ReteViewer.loadReteModel(ReteViewer.java:147)
at org.drools.eclipse.editors.DRLRuleEditor2$3.run(DRLRuleEditor2.java:244)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
15 years, 12 months
Re: [drools-user] The Eclipse JDT Core jar is not in the classpath error
by Xiandong Su
As a workaround, I have to manually add the drools jar files to the classpath instead of using the classpath generated by the wizard for the drools project. Does this mean that the classpath generated by the new project template is not sufficient?
thanks
Xiandong
----- Original Message ----
From: Xiandong Su <xiandongsu(a)yahoo.com>
To: Drools Users <user(a)drools.codehaus.org>
Sent: Monday, December 1, 2008 11:18:18 PM
Subject: [drools-user] The Eclipse JDT Core jar is not in the classpath error
I am using drools 4.0.7 plug in with eclipse 3.4.1. I created a drools project with the example generated by the wizard. However I am getting this exception when trying to run the example. I see there are discussion around this topic but I still do not have clear understand what the final solution should be. Does anyone have final solution?
thanks
Xiandong
org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:160)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:146)
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:121)
at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:98)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
at com.sample.DroolsTest.readRule(DroolsTest.java:50)
at com.sample.DroolsTest.main(DroolsTest.java:21)
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:91)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:52)
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:156)
... 7 more
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
15 years, 12 months
Action firing twice
by Vithal Kuchibhotla
Hello All,I have a list of Items that I am inserting into working memory. Here is the rule that is failing:rule "Cannot select X if both Y and Z are not selected"when Item(code == "X") (or (not Item(code == "Y")) (not Item(code == "Z")))then System.out.println("Error: You cannot select X unless both Y and Z are selected");endThis rule works correctly when X and Y are there, and when X and Z are there. However, when both Y and Z are missing, the error prints twice. Can anyone tell me what I am doing wrong.Thanks a lotVithal
15 years, 12 months