Problem splitting drl file into two files
by Shur, Bob
How do I declare a function in one drl file and call it from another drl file, without having the Eclipse plug-in flag the call as an error?
Eclipse complains that the function is undefined and puts a red X on the call.
Other than the red X, everything seems to work. Is there some equivalent of "extern" I can use to make Eclipse happy?
14 years, 4 months
How to write rules in two fact's fields?
by shanmuga
Hi,
I want to know, how to write rules in two fact's fields?
I used two facts, it will take AND condition or OR condition in between the
two facts.
Please check my code....
package Project
import com.sample.Person;
import com.sample.Price;
rule "rule_Name"
when
per:*Person*(50 <= age < 100, 10000 <= income < 50000, occupation
== "Business", category == "Military", location == "Bangalore", custype ==
"Individual")
pri:*Price*((20 <= price < 30) || price == 1)
then
System.out.println("Success");
end
The both fact values are satisfy means, what is the output?
I got output, even the *Price* fact's value is wrong. (price == 100)
Please slove my problem........!!!!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-rules-in-two-fact-s-fields...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
drools working memory backed by cache
by Apache Zoom
Is there a project out there which can use drools working
memory using hibernate 2nd level cache ( i.e. if the objects in working
memory get too old they get put in a cache )
A second related question is it would be nice if it could be done through hibernate using hibernate 2nd level cache ?
14 years, 4 months
How to even out n buckets in Drools Planner?
by aitchnyu
I have n buckets and mn entities. Each bucket must have m entities. Each
entity carries a weight. My objective is to even out the total weight per
bucket, make them close to the average.
For example, a solution like this is skewed, see their sums.
bucket 1: 1,2,4,5=12
bucket 2: 6,8,9,6=29
bucket 3: 7,7,4,7=25
The same entities may be placed into buckets like this. This is more
desirable as the sums are closer to the mean (and each other); one does not
dominate the others.
bucket 1: 1,8,7,4=20
bucket 2: 6,2,9,6=23
bucket 3: 7,7,5,4=23
*Question:*How do I write a rule for this:
for each bucket, penalize (with soft scores) a bucket whose total
entity.weight differs from the average total entity.weight of the buckets.
Will I get the same results when I penalize each bucket for differing with
*each other*?
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-even-out-n-buckets-in-Drools-Pla...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Where are JPA variablepersisters, in Drools 5.3?
by dunnlow
Using Drools 5.3, I'm trying to set up a statefull knowledgesession that
persists out to a database. With all of the examples on nabble and the
documentation (Example 2.10. JPA configuration for StatefulKnowledgeSessions
http://docs.jboss.org/drools/release/5.3.0.Final/droolsjbpm-introduction-...)
seems like it should be straight forward enough.
However, in all of those examples, variablepersisters are configured that
are in the package org.drools.persistence.processinstance.persisters (like:
<drools:persister for-class="javax.persistence.Entity"
implementation="org.drools.persistence.processinstance.persisters.JPAVariablePersister"
I can't find that package anywhere in Drools 5.3 (or JBPM 5.2). Can someone
PLEASE suggest where to find those classes/packages?
Is the documentation (above) incorrect/outdated? If so, can someone point
me to a working example of JPA transactions configured via Spring.
Thanks very much!
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Where-are-JPA-variablepersisters-in-Dro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
memory leak in Guvnor 5.3 when rules have incorrect regular expressions ?
by vadlam
we have hundreds of rules created in Guvnor 5.3..Final.
some of them use regular expressions when using the matches operator.
when business users enter an incorrect regular expression and rules are
built in guvnor subsequently, we have noticed heap consumption grow quite a
bit and not released subsequenlty.
currently, on a windows server that has approximately 1.3 GB heap available,
running 1 or builds consumes the whole memory and eventually crashes the
server.
The following is from one such log trace
[Near : {... **HST ....}]
^
[Line: 1, Column: 3]
[Error: Missing left node]
[Near : {... **HST ....}]
^
[Line: 1, Column: 3]
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:293)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at
org.drools.rule.builder.PatternBuilder.setInputs(PatternBuilder.java:903)
at
org.drools.rule.builder.PatternBuilder.buildRelationalExpression(PatternBuilder.java:599)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:540)
at
org.drools.rule.builder.PatternBuilder.processConstraintsAndBinds(PatternBuilder.java:398)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:314)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:131)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:807)
at
org.drools.guvnor.server.contenthandler.GuidedDTContentHandler.compile(GuidedDTContentHandler.java:63)
at
org.drools.guvnor.server.builder.PackageAssembler.loadAllButDRLAssets(PackageAssembler.java:83)
at
org.drools.guvnor.server.builder.PackageAssembler.loadAssets(PackageAssembler.java:73)
at
org.drools.guvnor.server.builder.PackageAssembler.buildPackage(PackageAssembler.java:65)
at
org.drools.guvnor.server.builder.PackageAssembler.compile(PackageAssembler.java:55)
at
org.drools.guvnor.server.RepositoryPackageOperations.buildPackage(RepositoryPackageOperations.java:506)
at
org.drools.guvnor.server.RepositoryPackageOperations.buildPackage(RepositoryPackageOperations.java:475)
at
org.drools.guvnor.server.RepositoryPackageService.buildPackage(RepositoryPackageService.java:314)
Any thoughts or suggestions around these memory leak issues?
--
View this message in context: http://drools.46999.n3.nabble.com/memory-leak-in-Guvnor-5-3-when-rules-ha...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months