Should lhs pattern be the same for diffrent Rules in a Rule Base?
by Mehak
Hi
I have a rule using xml.
<!-- 1st Rules For Field objects-->
<rule name="Rule1">
<lhs>
<pattern identifier="outterMap" object-type="HashMap" />
<pattern identifier="innerMap" object-type="HashMap">
<from>
<expression>outterMap.get("fact")</expression>
</from>
</pattern>
<pattern identifier="field" object-type="Filterable">
<from>
<expression>innerMap.get("filterable")</expression>
</from>
</pattern>
<pattern identifier = "document" object-type="Document">
<from> <expression> field.getDocument();")</expression>
</from>
</pattern>
<eval> document.getIsNormalTask()</eval>
</lhs>
<rhs>
field.setDefaultOptionality(Boolean.TRUE);
</rhs>
</rule>
Another Rule is
<!-- 2 nd Rule for Menu Items-->
<rule name="Rule2">
<lhs>
<pattern identifier="outterMap" object-type="HashMap" />
<pattern identifier="innerMap" object-type="HashMap">
<from>
<expression>outterMap.get("fact")</expression>
</from>
</pattern>
<pattern identifier="editMode" object-type="Boolean">
<from>
<expression>innerMap.get("editMode")</expression>
</from>
</pattern>
<pattern identifier="menuItem" object-type="Filterable">
<from>
<expression>innerMap.get("filterable")</expression>
</from>
</pattern>
<pattern identifier = "document" object-type="Document">
<from> <expression> menuItem.getDocument();")</expression>
</from>
</pattern>
<eval>editMode==true && !document.isInDraftStatus()</eval>
</lhs>
<rhs>
menuItem.setDefaultVisibility((Boolean)true);
</rhs>
</rule>
The total classes that I have are:
Filterable.java
Field.java inherits Filterable (contains Document object)
MenuItem.java inherits Filterable (contains Document object)
Document.java
I am setting up the filter based on rule name such that
for MenuItems rule executed is : Rule2
For Field objects rule executed is :Rule1
The problem is that all the rules are executed for all the objects passed as
facts and statements above <lhs> are matched. As these are diffrent, runtime
error is displayed that error in Rule1, getOptionality for field producing
error.
Basically I want to know should lhs be the same for all the rules in the
Rule Base? And why are all the patterns matched for a given fact in working
memory?
Thanks
--
View this message in context: http://www.nabble.com/Should-lhs-pattern-be-the-same-for-diffrent-Rules-i...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months
Facts - can they be non Java Beans
by sridhar123
I am trying to access Fact objects that are not always java beans. Example:
Class A {
Arraylist Class B b
getFirst() { return b.first() }
}
In above Class i dont have any variable called "first" - but returning first
element of the list.
Now following DRL throws compilation errors.
rule "Some Rule"
when
$MyFact :A()
$first : $myFact.getFirst()
then
....
....
end
Is there any way to execute the above - or i should have class variable
"first" and access that?
thank you
Sridhar
--
View this message in context: http://www.nabble.com/Facts---can-they-be-non-Java-Beans-tp17130130p17130...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months
4.0.7 Maven Repo?
by Ingomar Otter
As 4.0.7 seems to be GA, will repository.jboss.com/maven2 also be
updated?
--I
--
Ingomar Otter
Chief Technology Officer
mailto:ingomar.otter@valtech.de
Mobile: +49 172 2367867
Valtech GmbH
Bahnstraße 16
40212 Düsseldorf
Germany
Phone: +49 (0)211 179237-0
Fax: +49 211 179237-19
http://www.valtech.de
Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672
16 years, 6 months
Drools 4.0.7 released
by Edson Tirelli
All,
We just released Drools v4.0.7.
This is an important bugfix release because it has the cumulative fixes
from the version 4.0.5 and 4.0.6 that were rolled back. We strongly advise
you all to update.
We would like to thank all the people that helped us, testing,
developing, providing patches, ideas and recommendation, and special to the
ones that answered our call for tests.
Bellow you can find the cumulative release notes for Drools version
4.0.5, 4.0.6 and 4.0.7.
Happy drooling,
Edson
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
Release Notes for JBoss Drools Includes versions: 4.0.5 4.0.6 4.0.7
------------------------------
Feature Request
- [ JBRULES-1307 <http://jira.jboss.com/jira/browse/JBRULES-1307> ]
Update and expand documentation for decision tables to show actual uses for
all keywords
- [ JBRULES-1338 <http://jira.jboss.com/jira/browse/JBRULES-1338> ]
DirectoryScanner should only take into account relevant files
- [ JBRULES-1473 <http://jira.jboss.com/jira/browse/JBRULES-1473> ] Add a
configuration parameter to allow Drools to dump all generated java source
code
- [ JBRULES-1532 <http://jira.jboss.com/jira/browse/JBRULES-1532> ]
Import decision table into jBRMS application
- [ JBRULES-1577 <http://jira.jboss.com/jira/browse/JBRULES-1577> ]
BeforeActivationFireEvent.toString() should print out activation number
- [ JBRULES-1590 <http://jira.jboss.com/jira/browse/JBRULES-1590> ]
ShadowProxuUtils and org.hibernate.collection.PersistentSet
Bug
- [ JBRULES-1111 <http://jira.jboss.com/jira/browse/JBRULES-1111> ] Final
methods of POJO's aer never evaluated
- [ JBRULES-1216 <http://jira.jboss.com/jira/browse/JBRULES-1216> ]
log4j.xml contained in drools-repository.jar
- [ JBRULES-1286 <http://jira.jboss.com/jira/browse/JBRULES-1286> ]
Incorrect information in section 2.5.7.3. Agenda Filters
- [ JBRULES-1315 <http://jira.jboss.com/jira/browse/JBRULES-1315> ] Rule
that uses a 'collect' and 'from' clause together causes problem
- [ JBRULES-1327 <http://jira.jboss.com/jira/browse/JBRULES-1327> ]
drools-ant task and java.lang.ClassCastException:
org.drools.reteoo.ReteooRuleBase
- [ JBRULES-1329 <http://jira.jboss.com/jira/browse/JBRULES-1329> ]
RuleBase.removeRule() prevents other rules from being applied
- [ JBRULES-1330 <http://jira.jboss.com/jira/browse/JBRULES-1330> ] Using
RuleBase in multithread application server environment
- [ JBRULES-1357 <http://jira.jboss.com/jira/browse/JBRULES-1357> ]
RuleBuildContext does not initialize package of rule
- [ JBRULES-1388 <http://jira.jboss.com/jira/browse/JBRULES-1388> ] Eval
error when using multiple declarations
- [ JBRULES-1389 <http://jira.jboss.com/jira/browse/JBRULES-1389> ] using
eval after using or causes ClassCastException
- [ JBRULES-1392 <http://jira.jboss.com/jira/browse/JBRULES-1392> ] Rules
behave incorrectly (randomly) in multi-threaded environment
- [ JBRULES-1414 <http://jira.jboss.com/jira/browse/JBRULES-1414> ]
Cannot build from source -- missing directory or pom file
- [ JBRULES-1415 <http://jira.jboss.com/jira/browse/JBRULES-1415> ]
Certain uses of from causes NullPointerException in WorkingMemoryLogger
- [ JBRULES-1423 <http://jira.jboss.com/jira/browse/JBRULES-1423> ]
ObjectFactory$ObjectEqualsComparator.equals throws NPE if second arg is null
- [ JBRULES-1426 <http://jira.jboss.com/jira/browse/JBRULES-1426> ] NPE
in ObjectFactory$ObjectEqualsComparator
- [ JBRULES-1428 <http://jira.jboss.com/jira/browse/JBRULES-1428> ]
ClassCastException when comparing BigDecimal fields
- [ JBRULES-1429 <http://jira.jboss.com/jira/browse/JBRULES-1429> ] NPE
in ObjectEqualsComparator
- [ JBRULES-1435 <http://jira.jboss.com/jira/browse/JBRULES-1435> ] NPE
if rule checks a Long field for null, and a fact is passed in with Long
field that is NOT null.
- [ JBRULES-1436 <http://jira.jboss.com/jira/browse/JBRULES-1436> ]
Filescanner throws NPE when there's a compile error.
- [ JBRULES-1438 <http://jira.jboss.com/jira/browse/JBRULES-1438> ]
FactTemplate Property Access leads to RuleBuilder Exception
- [ JBRULES-1443 <http://jira.jboss.com/jira/browse/JBRULES-1443> ]
retract of Fact Template leads to NPE
- [ JBRULES-1446 <http://jira.jboss.com/jira/browse/JBRULES-1446> ]
ClassCastException when iterating over an array using "from"
- [ JBRULES-1447 <http://jira.jboss.com/jira/browse/JBRULES-1447> ]
Parser error when using keyword operators
- [ JBRULES-1448 <http://jira.jboss.com/jira/browse/JBRULES-1448> ]
MVELDataProver throws nullpointer on null return value from expression
- [ JBRULES-1451 <http://jira.jboss.com/jira/browse/JBRULES-1451> ] LHS
expression comparing a Boolean to a String does not fail but always returns
true
- [ JBRULES-1453 <http://jira.jboss.com/jira/browse/JBRULES-1453> ]
boss.seam.Component) - Exception calling component @Destroy method:
repository
- [ JBRULES-1456 <http://jira.jboss.com/jira/browse/JBRULES-1456> ] Or
using DSL language
- [ JBRULES-1459 <http://jira.jboss.com/jira/browse/JBRULES-1459> ]
parser/scanner bug: "unterminated literal"
- [ JBRULES-1464 <http://jira.jboss.com/jira/browse/JBRULES-1464> ]
Comilation error : 'Syntax error on token ",", delete this token' when
referencing a global in an accumulate block
- [ JBRULES-1467 <http://jira.jboss.com/jira/browse/JBRULES-1467> ]
Concurrency errors when parsing strings to dates in rules
- [ JBRULES-1472 <http://jira.jboss.com/jira/browse/JBRULES-1472> ]
Problem when mixing alpha and beta constraints in a composite constraint
- [ JBRULES-1477 <http://jira.jboss.com/jira/browse/JBRULES-1477> ] User
exception thrown from inside a rule always causes a stackTrace to console
- [ JBRULES-1479 <http://jira.jboss.com/jira/browse/JBRULES-1479> ]
Exception compiling rules
- [ JBRULES-1480 <http://jira.jboss.com/jira/browse/JBRULES-1480> ]
Potential multithreaded problem in MVELClassFieldExtractor
- [ JBRULES-1481 <http://jira.jboss.com/jira/browse/JBRULES-1481> ] Stop
actionQueue recursion in working memory
- [ JBRULES-1482 <http://jira.jboss.com/jira/browse/JBRULES-1482> ] Bug
with ReeteoRuleBase and merged package
- [ JBRULES-1484 <http://jira.jboss.com/jira/browse/JBRULES-1484> ] Mvel,
constructor and package access
- [ JBRULES-1487 <http://jira.jboss.com/jira/browse/JBRULES-1487> ]
access to store property in MapBackedClassLoader should be synchronized
- [ JBRULES-1489 <http://jira.jboss.com/jira/browse/JBRULES-1489> ]
Working Memory deserialization causes NPE
- [ JBRULES-1490 <http://jira.jboss.com/jira/browse/JBRULES-1490> ]
org.drools.util.AbstractHashTable$SingleIndex is not serializable
- [ JBRULES-1491 <http://jira.jboss.com/jira/browse/JBRULES-1491> ]
java.io.NotSerializableException:
org.drools.util.AbstractHashTable$SingleIndex
- [ JBRULES-1492 <http://jira.jboss.com/jira/browse/JBRULES-1492> ] NPE
caused by non-shadowed deep object access
- [ JBRULES-1501 <http://jira.jboss.com/jira/browse/JBRULES-1501> ]
Multiples modify causes variable duplication exception
- [ JBRULES-1503 <http://jira.jboss.com/jira/browse/JBRULES-1503> ]
Errors on rulebase serialization scenarios
- [ JBRULES-1505 <http://jira.jboss.com/jira/browse/JBRULES-1505> ] Fix
CCE when using nested accessors to compare Date values
- [ JBRULES-1506 <http://jira.jboss.com/jira/browse/JBRULES-1506> ]
RuleAgent will not read binary packages from Apache HTTP Server
- [ JBRULES-1507 <http://jira.jboss.com/jira/browse/JBRULES-1507> ]
Objenesis too heavily used
- [ JBRULES-1508 <http://jira.jboss.com/jira/browse/JBRULES-1508> ] NPE
in MVELDataProvider
- [ JBRULES-1510 <http://jira.jboss.com/jira/browse/JBRULES-1510> ]
ObejnesisFactory.getStaticObjenesis() doesn't set OBJENESIS_INSTANCE
- [ JBRULES-1512 <http://jira.jboss.com/jira/browse/JBRULES-1512> ]
UnsupportedOperationException when calling addPackage on rulebase
- [ JBRULES-1515 <http://jira.jboss.com/jira/browse/JBRULES-1515> ]
Boolean negation operator doesn't work
- [ JBRULES-1517 <http://jira.jboss.com/jira/browse/JBRULES-1517> ]
NumberFormatException in ObjectEqualsComparator.equals
- [ JBRULES-1519 <http://jira.jboss.com/jira/browse/JBRULES-1519> ]
Regression on alpha composite constraints
- [ JBRULES-1521 <http://jira.jboss.com/jira/browse/JBRULES-1521> ]
ClassNotFound when deserializing rulebase
- [ JBRULES-1522 <http://jira.jboss.com/jira/browse/JBRULES-1522> ]
Accumulate and Collect memories are not Serializable
- [ JBRULES-1525 <http://jira.jboss.com/jira/browse/JBRULES-1525> ]
MVELCalendarCoercionTest and MVELDateCoercionTest do not passed on 4.0.x
- [ JBRULES-1526 <http://jira.jboss.com/jira/browse/JBRULES-1526> ] MVEL
org/mvel/integration/impl/LocalVariableResolverFactory
- [ JBRULES-1527 <http://jira.jboss.com/jira/browse/JBRULES-1527> ] URL
for Eclipse plugin outdated in install doc
- [ JBRULES-1533 <http://jira.jboss.com/jira/browse/JBRULES-1533> ]
WorkingMemoryLogger implementations should take WorkingMemoryEventManager as
a constructor
- [ JBRULES-1534 <http://jira.jboss.com/jira/browse/JBRULES-1534> ]
Eclipse MANIFEST.MF files reference the incorrect name for mvel
- [ JBRULES-1542 <http://jira.jboss.com/jira/browse/JBRULES-1542> ] the
nested type org.drools..... cannot be referenced by it's binary name
- [ JBRULES-1543 <http://jira.jboss.com/jira/browse/JBRULES-1543> ] tests
failing with JANINO
- [ JBRULES-1556 <http://jira.jboss.com/jira/browse/JBRULES-1556> ]
Modify is not normalising activations, which is impacting lock-on-active
- [ JBRULES-1558 <http://jira.jboss.com/jira/browse/JBRULES-1558> ] || in
conditional element causes exception
- [ JBRULES-1560 <http://jira.jboss.com/jira/browse/JBRULES-1560> ] Add
support to quoting commas in decision tables
- [ JBRULES-1564 <http://jira.jboss.com/jira/browse/JBRULES-1564> ]
Salience does not work for sequential mode
- [ JBRULES-1566 <http://jira.jboss.com/jira/browse/JBRULES-1566> ]
Documentation on update()
- [ JBRULES-1568 <http://jira.jboss.com/jira/browse/JBRULES-1568> ] Java
debug not working with multiple rule files
- [ JBRULES-1572 <http://jira.jboss.com/jira/browse/JBRULES-1572> ]
sometimes getting ClassFieldExtractor error
- [ JBRULES-1574 <http://jira.jboss.com/jira/browse/JBRULES-1574> ]
Unable to open DSL file in BRMS (Exception)
- [ JBRULES-1575 <http://jira.jboss.com/jira/browse/JBRULES-1575> ]
Guided editor missing "and less than (or equal to)" option in drop-down list
- [ JBRULES-1576 <http://jira.jboss.com/jira/browse/JBRULES-1576> ]
Cannot download model assets from BRMS using Internet Explorer 7
- [ JBRULES-1578 <http://jira.jboss.com/jira/browse/JBRULES-1578> ]
Guided rules report error due to incorrect quotes around rule attribute
values
- [ JBRULES-1580 <http://jira.jboss.com/jira/browse/JBRULES-1580> ] BRMS
ruleflow upload page incorrectly states that .rf files should be uploaded
- [ JBRULES-1581 <http://jira.jboss.com/jira/browse/JBRULES-1581> ]
Invalid dialect name causes NullPointerException in BRMS and Eclipse plug-in
rule editor
- [ JBRULES-1583 <http://jira.jboss.com/jira/browse/JBRULES-1583> ] Heap
and scheduled Activations
- [ JBRULES-1593 <http://jira.jboss.com/jira/browse/JBRULES-1593> ] 4.0.x
and trunk build fails as eclipse.org GEF download location has moved
- [ JBRULES-1594 <http://jira.jboss.com/jira/browse/JBRULES-1594> ]
Collect result pattern no constrained by bounded variables
- [ JBRULES-1597 <http://jira.jboss.com/jira/browse/JBRULES-1597> ]
Eclipse DroolsBuilder hangs due to MVEL error on "object.var1 matches $var2"
Task
- [ JBRULES-1502 <http://jira.jboss.com/jira/browse/JBRULES-1502> ]
update example to use modify block as default
- [ JBRULES-1513 <http://jira.jboss.com/jira/browse/JBRULES-1513> ]
Drools 4.0.5 release
Patch
- [ JBRULES-1452 <http://jira.jboss.com/jira/browse/JBRULES-1452> ]
Improved NullPointerException messages
- [ JBRULES-1485 <http://jira.jboss.com/jira/browse/JBRULES-1485> ] Fixes
to the documentation
Release
- [ JBRULES-1600 <http://jira.jboss.com/jira/browse/JBRULES-1600> ]
Release Drools v4.0.7
16 years, 6 months
RE: [rules-users] Newbie question / NoSuchMethodError error
by Hehl, Thomas
I'm not entirely sure I understand what you're saying, but you could write a
new property that stores the int value and takes and returns a String.
Anyway, glad you figured it out.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Cabou, Carl
Sent: Thursday, May 08, 2008 10:41 AM
To: Rules Users List
Subject: RE: [rules-users] Newbie question / NoSuchMethodError error
Thomas,
I can not move the headings since I do receive "0 - 50" as a String and then
I have to return an Integer.
I've made a little program beside this to test my rule, I've launched it
using java5, it worked fine, but it does crash using java1.4.
I just found out the Integer.valueOf(int) is a new feature of java5.
So I guess I must try to run my web application using java5.
Carl.
-----Message d'origine-----
De : rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] De la part de Hehl, Thomas
Envoyé : jeudi 8 mai 2008 10:20
À : 'Rules Users List'
Objet : RE: [rules-users] Newbie question / NoSuchMethodError error
No, really, java uses the valueOf methods internally to try to convert the
object specified (a String) into an Integer so it can do the comparison. You
can't do selected == "0 - 50" because "0 - 50" is a String and you cant
compare it to an Integer.
So what are you trying to do? If you want selected to be in the range
between 0 and 50 inclusive, then you need to change the heading in your
decision table. Here's an example:
daysBeforeSummons >= $1, daysBeforeSummons <= $2
and then you specify the data in your column as 0,50.
Good luck!
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Cabou, Carl
Sent: Thursday, May 08, 2008 10:12 AM
To: Rules Users List
Subject: RE: [rules-users] Newbie question / NoSuchMethodError error
Thank you for answering Thomas.
Here is the code below, nothing fancy:
public void setSelected (Integer calculatedSetSelected)
{
this. calculatedSetSelected = calculatedSetSelected;
}
In fact, the problem IS that it is taking an Integer and some Drools
Internal method want to convert it using Integer.valueOf, but there is no
Integer.valueOf taking Integer.
There is something weird, in the stack trace, I get :
Caused by: java.lang.NoSuchMethodError:
java.lang.Integer.valueOf(I)Ljava/lang/Integer;
at AL_Calculation.Rule_ setSelecte_10_0.consequence(Unknown Source)
There is a missing "d" before "_10" ...
Carl
-----Message d'origine-----
De : rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] De la part de Hehl, Thomas
Envoyé : jeudi 8 mai 2008 09:35
À : 'Rules Users List'
Objet : RE: [rules-users] Newbie question / NoSuchMethodError error
Yep. Post the code for setSelected(). I'm guessing it takes an Integer or
int and you're passing it a String.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Cabou, Carl
Sent: Thursday, May 08, 2008 9:23 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Newbie question / NoSuchMethodError error
Greetings,
I'm new to Drools and I've written a decision table based rule using excel.
The rule validates ok and I've deployed my package fine.
I've written a piece of code to test my rules, I want to set the
calculatedRate to 125 when I get selected field equal to "0 - 50" :
...
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new
Data(); data.setSelected("0 - 50"); statelessSession.execute(data); // set
private Integer field ...
When I run the code I get a exeption :
java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I)Ljava/lang/Integer;
I don't understand why Drools tries to convert to Integer something which is
already Integer !!!!
-----------
Here is the rules code.
rule "setCalculateRate_11"
salience 65525
when
Data(selected == "0 - 50")
then
object.setCalculatedRate(125);
end
--------------
The CalculatedRate field is a java.lang.Integer object.
Does anybody has an idea ??
Regards,
Carl.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 6 months
RE: [rules-users] Newbie question / NoSuchMethodError error
by Hehl, Thomas
Yep. Post the code for setSelected(). I'm guessing it takes an Integer or
int and you're passing it a String.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Cabou, Carl
Sent: Thursday, May 08, 2008 9:23 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Newbie question / NoSuchMethodError error
Greetings,
I'm new to Drools and I've written a decision table based rule using excel.
The rule validates ok and I've deployed my package fine.
I've written a piece of code to test my rules, I want to set the
calculatedRate to 125 when I get selected field equal to "0 - 50" :
...
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new
Data(); data.setSelected("0 - 50"); statelessSession.execute(data); // set
private Integer field ...
When I run the code I get a exeption :
java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I)Ljava/lang/Integer;
I don't understand why Drools tries to convert to Integer something which is
already Integer !!!!
-----------
Here is the rules code.
rule "setCalculateRate_11"
salience 65525
when
Data(selected == "0 - 50")
then
object.setCalculatedRate(125);
end
--------------
The CalculatedRate field is a java.lang.Integer object.
Does anybody has an idea ??
Regards,
Carl.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 6 months
Newbie question / NoSuchMethodError error
by Cabou, Carl
Greetings,
I'm new to Drools and I've written a decision table based rule using excel.
The rule validates ok and I've deployed my package fine.
I've written a piece of code to test my rules, I want to set the calculatedRate to 125 when I get selected field equal to "0 - 50" :
...
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new Data(); data.setSelected("0 - 50"); statelessSession.execute(data); // set private Integer field ...
When I run the code I get a exeption :
java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I)Ljava/lang/Integer;
I don't understand why Drools tries to convert to Integer something which is already Integer !!!!
-----------
Here is the rules code.
rule "setCalculateRate_11"
salience 65525
when
Data(selected == "0 - 50")
then
object.setCalculatedRate(125);
end
--------------
The CalculatedRate field is a java.lang.Integer object.
Does anybody has an idea ??
Regards,
Carl.
16 years, 6 months
Help in using drools
by Stelarinc
Hi,
I would like to use drools in my application. However, there are a few things that I do not quite understand and whether it can fit my requirements. I have tried to search through the documentation and mailing list, but to no avail.
Here is my situation. I am creating a web-based application which requires me to run certain rules for certain page. What I need is to pass all the information accumulated from the pages and pass it through a rule engine. Each rule will check the information and return string message(s) to the caller. Does drools fit in this requirements?
>From what I understand, I can create a stateful session, passing the information to the rule engine. But when I need to return the result, how do I do that? Do I pass an empty String List into the rule engine, and each rule will add the message to the List if there is an error?
Thank you.
Regards,
Leonard Soetedjo
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
16 years, 6 months