Golfer Example: Why will the example get two equal result ?
by jason
When I test the Golfer example in Drools4.0 environment. I found the rule
was matched twice but print same result. I try to override equals() and
hashCode() method in Golfer Object, but no change happen. Who can tell me
the reason that happened?
Thanks.
Jason Wang
17 years, 4 months
Simple JBoss Rules Sample
by Robert Burdick
Hello All:
I am brand new to JBoss Rules / Drools development. I have found the
examples with the version 3.0.6 download extremely unenlightening. Can
anyone point me to a simple starter application to get a feel for how all of
this works? A simple thick client GUI or command line application would be
great. Preferably not just a collection og JUnit TestCases, but a real
application, no matter how simple, that shows how to exercise the rules
engine from Java would be very helpful to me.
Thanks, Robert
17 years, 4 months
How to accumulate from objects in a collection?
by Felipe Piccolini
Hi,
this is just a dumb question for drools-languaje gurus... like
Edson :)
How ca I write a rule (CE in LHS) for accumulate atributes inside an
object, but this objects are not facts,
they are inside a collection which is an attribute from a fact...
pretty messy right?...lol..
well, the business problem is this.
I need to count (accumulate) vacation days used on previous vacation
requests.
I have an User (which is one fact) having a collection of
oldVacationRequests
and an actual VacationRequest (the another fact).
So the rules is like this: discount to the available days for
vacation those used in previous
vacation request, and those days are the days between initDate and
endDate in each
old vacation request with isAproved seted true and having endDate
before the actual
vacation request initDate.
did I explain myself?...
so I need to know if this is possible I was trying to do something
like this...but is obviously wrong...:)
rule "remove used vacation days"
no-loop
when
vr: VacationRequestVO($days: availableDays , $iniDate: initDate )
$u: UserVO( $vacReqList: vacationRequestList )
$usedDays: Number (intValue > 1) from accumulate ( $ovr:
VacationRequestVO( isAproved == true, endDate < $iniDate, $uDays:
usedDays),
from $vacReqList, count($uDays))
then
vr.setAvailableDays($days - $usedDays);
end
Thanks...
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl
17 years, 4 months
RuleML-2007 Challenge - Extended Deadlines, 7th/17th August
by Adrian Paschke
[Apologies for multiple postings]
-- Extended Deadlines: August 7th/17th --
RuleML-2007 Challenge: Rule Technology Showcase
October, 25th, 2007 - Orlando, Florida
http://2007.ruleml.org/index-Dateien/Page787.htm
With its unique emphasis on the practical use of rule technologies in
distributed Web-based environments, RuleML-2007 will feature a Challenge
with a focus on rule applications and rule-based tools. The challenge
offers participants a unique possibility to demonstrate their commercial
or open source tools, use cases, and applications.
Those demo paper submissions that are received by August 7th, and
accepted, will participate in the Challenge and be published in the
Springer LNCS Proceedings.
Those that are received a little later, but by August 17th very latest,
and accepted, will participate in the Challenge and may be considered
for publication in the Proceedings.
Submissions of demo papers (3-5 pages) for the RuleML-2007 Challenge can
be sent to
ruleml2007 AT easychair.org.
The RuleML-2007 Challenge is being held as part of the International
RuleML Symposium on Rule Interchange and Applications (RuleML-2007:
http://2007.ruleml.org/) - to be held in Orlando, Florida, on 25th/26th
October, in co-location with the 10th Business Rules Forum.
RuleML-2007 is devoted to practical distributed rule technologies and
rule-based applications which need language standards for rules
operating in the context of, e.g., the Semantic Web, Web 2.0/3.0,
Intelligent Multi-Agent Systems, Event-Driven Architectures and
Service-Oriented Computing Applications.
For more information please visit:
http://2007.ruleml.org/
Sincerely Yours,
Adrian Paschke
(RuleML-2007 Co-Chair)
17 years, 4 months
Re: [rules-users] nested accessors with Sets
by mark.mcnally@comcast.net
Edson,
Thank you for the response. I tried writing the in-line eval as suggested but get this Exception:
org.drools.rule.InvalidRulePackage: Unable to determine the used declarations : [Rule name=State, agendaGroup=MAIN, salience=0, no-loop=false]
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
at [...]
This is my rule:
rule State
dialect "mvel"
when
$ca:CandidateAssociation( eval ( ! nurseDetails.stateLicensures.contains( patientDetails.state ) ) )
then
retract( $ca );
end
I haven't yet but, plan to open an issue in JIRA as requested
Thanks for your help.
Mark
-------------- Original message ----------------------
From: "Edson Tirelli" <tirelli(a)post.com>
> Mark,
>
> Sorry for not answering before. I was doing some research.
> What you found is a bug. Contains and not contains are supported
> operations in Drools, but the case you are facing is that you are using
> these operators with accessors expressions (e.g.
> nurseDetails.stateLicensures ). When an accessor expression is used, the
> engine converts the whole expression in an inline-eval. So what you are
> doing will be interpreted by the engine as:
>
> $ca:CandidateAssociation( eval ( nurseDetails.stateLicensures not
> contains patientDetails.state ) )
>
> Problem is that "not contains" is not a valid operator for MVEL. May I
> ask you please to open a JIRA for that? I will fix it asap.
>
> Meanwhile, to work around the problem you can either avoid the accessor
> path expression when using "contains/memberOf/matches" and their
> corresponding negations, or write the inline eval yourself, avoid a
> mistranslation by the engine. So, if you are using mvel dialect for your
> rule, you could write:
>
> rule XXX
> dialect "mvel"
> when
> $ca:CandidateAssociation( eval ( ! nurseDetails.stateLicensures.contains(
> patientDetails.state ) ) )
> then
> // do something
> end
>
> Please not that as you are explicitly declaring the mvel dialect for your
> rule, your consequence will also be an MVEL block.
>
> Sorry for the inconvenience. I will fix that for 4.0.1.
>
> Thanks,
> Edson
>
> 2007/8/1, mark.mcnally(a)comcast.net <mark.mcnally(a)comcast.net>:
> >
> >
> > Actually, it is still broken.
> >
> > This does not complain but it always executes the consequence, even when
> > the stateLicensures includes the state that in patientDetails.state
> >
> > $ca:CandidateAssociation(nurseDetails.stateLicensures not contains
> > patientDetails.state )
> >
> >
> > I also tried the following but it complains with an Exception
> >
> > $ca:CandidateAssignment(participantDetails.state not memberof
> > nurseDetails.stateLicensures )
> >
> >
> > org.drools.rule.InvalidRulePackage: [13,50]: unknown:13:50 Unexpected
> > token 'not'[13,93]: unknown:13:93 mismatched token:
> > [@98,574:574=')',<13>,13:93]; expecting type LEFT_PAREN
> > at org.drools.rule.Package.checkValidity(Package.java:408)
> > at org.drools.common.AbstractRuleBase.addPackage(
> > AbstractRuleBase.java:288)
> >
> >
> > Is what I am trying to do supported by Drools?
> >
> > Thank you,
> > Mark
> >
> >
> > -------------- Original message ----------------------
> > From: mark.mcnally(a)comcast.net
> > > My rule now appears to be working after switching from the
> > "excludes" operator
> > > to the newer "not contains".
> > >
> > > This works:
> > > $ca:CandidateAssociation(nurseDetails.stateLicensures not contains
> > > patientDetails.state )
> > >
> > > This does not:
> > > $ca:CandidateAssociation(nurseDetails.stateLicensures excludes
> > > patientDetails.state )
> > >
> > >
> > > Mark
> > >
> > > -------------- Original message ----------------------
> > > From: mark.mcnally(a)comcast.net
> > > > Hello,
> > > >
> > > > Please excuse me if I have double posted - my first did not seem to
> > appear.
> > > >
> > > > I am wondering if the following is valid rule syntax. I am getting a
> > > stacktrace
> > > > when the rules fire that points to a ClassCastException on a HashSet
> > > >
> > > > I am using v4.0 GA.
> > > >
> > > > Thank you, Mark
> > > >
> > > >
> > > > rule StateMatch
> > > > when
> > > > $ca:CandidateAssociation(nurseDetails.stateLicensures excludes
> > > > patientDetails.state )
> > > > then
> > > > retract( $ca );
> > > > end
> > > >
> > > >
> > > > public class CandidateAssociation {
> > > > private PatientDetails patientDetails;
> > > > private NurseDetails nurseDetails;
> > > > private int overlapHours;
> > > >
> > > > public CandidateAssociation( PatientDetails patientDetails,
> > NurseDetails
> > > > nurseDetails) {
> > > > super();
> > > > this.patientDetails = patientDetails;
> > > > this.nurseDetails = nurseDetails;
> > > > overlapHours =
> > > > participantDetails.getNumberOverlapHourCnt(nurseDetails);
> > > > }
> > > > [...]
> > > > }
> > > >
> > > > public class NurseDetails {
> > > > private Set stateLicensures = new HashSet();
> > > > [...]
> > > > }
> > > > public class PatientDetails {
> > > > private String state;
> > > > [...]
> > > > }
> > > >
> > > > ------------------------------------------------------
> > > > Firing Rules
> > > > **********
> > > > org.drools.RuntimeDroolsException: Exception executing predicate
> > > > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :197)
> > > > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > > > at
> > > >
> > > org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
> > (CompositeObje
> > > > ctSinkAdapter.java:317)
> > > > at
> > > > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > > > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > > > at
> > > > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > > > at
> > > > org.drools.reteoo.ReteooWorkingMemory.doInsert(
> > ReteooWorkingMemory.java:70)
> > > > at
> > > > org.drools.common.AbstractWorkingMemory.insert(
> > AbstractWorkingMemory.java:772)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:64)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:58)
> > > > at
> > > >
> > > org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence
> > (Rule_Init
> > > > ializeCandidateForEachNurse_0.java:13)
> > > > at
> > > >
> > >
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > > >
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > > > at
> > > > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > > > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java
> > :467)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 403)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 384)
> > > > at
> > > > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(
> > PrimaryNursePOC.java:136)
> > > > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > > > Caused by: java.lang.ClassCastException: java.util.HashSet
> > > > at
> > > >
> > > org.drools.base.mvel.MVELPredicateExpression.evaluate(
> > MVELPredicateExpression.ja
> > > > va:35)
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :191)
> > > > ... 17 more
> > > > org.drools.RuntimeDroolsException: Exception executing predicate
> > > > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :197)
> > > > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > > > at
> > > >
> > > org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
> > (CompositeObje
> > > > ctSinkAdapter.java:317)
> > > > at
> > > > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > > > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > > > at
> > > > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > > > at
> > > > org.drools.reteoo.ReteooWorkingMemory.doInsert(
> > ReteooWorkingMemory.java:70)
> > > > at
> > > > org.drools.common.AbstractWorkingMemory.insert(
> > AbstractWorkingMemory.java:772)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:64)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:58)
> > > > at
> > > >
> > > org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence
> > (Rule_Init
> > > > ializeCandidateForEachNurse_0.java:13)
> > > > at
> > > >
> > >
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > > >
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > > > at
> > > > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > > > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java
> > :467)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.doOtherwise(
> > AbstractWorkingMemory.java:4
> > > > 30)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 412)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 384)
> > > > at
> > > > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(
> > PrimaryNursePOC.java:136)
> > > > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > > > Caused by: java.lang.ClassCastException: java.util.HashSet
> > > > at
> > > >
> > > org.drools.base.mvel.MVELPredicateExpression.evaluate(
> > MVELPredicateExpression.ja
> > > > va:35)
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :191)
> > > > ... 18 more
> > > > Exception in thread "main" org.drools.spi.ConsequenceException:
> > > > org.drools.RuntimeDroolsException: Exception executing predicate
> > > > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > > > at
> > > > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:507)
> > > > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java
> > :467)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.doOtherwise(
> > AbstractWorkingMemory.java:4
> > > > 30)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 412)
> > > > at
> > > >
> > > org.drools.common.AbstractWorkingMemory.fireAllRules(
> > AbstractWorkingMemory.java:
> > > > 384)
> > > > at
> > > > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(
> > PrimaryNursePOC.java:136)
> > > > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > > > Caused by: org.drools.RuntimeDroolsException: Exception executing
> > predicate
> > > > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :197)
> > > > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > > > at
> > > >
> > > org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
> > (CompositeObje
> > > > ctSinkAdapter.java:317)
> > > > at
> > > > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > > > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > > > at
> > > > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > > > at
> > > > org.drools.reteoo.ReteooWorkingMemory.doInsert(
> > ReteooWorkingMemory.java:70)
> > > > at
> > > > org.drools.common.AbstractWorkingMemory.insert(
> > AbstractWorkingMemory.java:772)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:64)
> > > > at
> > > > org.drools.base.DefaultKnowledgeHelper.insert(
> > DefaultKnowledgeHelper.java:58)
> > > > at
> > > >
> > > org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence
> > (Rule_Init
> > > > ializeCandidateForEachNurse_0.java:13)
> > > > at
> > > >
> > >
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > > >
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > > > at
> > > > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > > > ... 6 more
> > > > Caused by: java.lang.ClassCastException: java.util.HashSet
> > > > at
> > > >
> > > org.drools.base.mvel.MVELPredicateExpression.evaluate(
> > MVELPredicateExpression.ja
> > > > va:35)
> > > > at
> > > > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java
> > :191)
> > > > ... 18 more
> > > > _______________________________________________
> > > > 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
> >
>
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
17 years, 4 months
Update error: handle not found for object
by hypnosat7
hi I have an exception after using an update
This is my rule :
package packageDrlTest
#list any import classes here.
import java.lang.Integer;
#declare any global variables here
rule "incrementation"
no-loop
when
unEntier : java.lang.Integer()
then
unEntier++;
System.out.println("incrementation firing...");
update(unEntier);
end
when I execute my rule on this list of facts :
List integerList = new ArrayList();
integerList.add(Integer.valueOf(1));
for (Object fact : integerList )
{
session.insert(fact); // session is a StatefulMemory
}
Update error: handle not found for object: 2. Is it in the working memory?
détails :
incrementation firing...
org.drools.FactException: Update error: handle not found for object: 2. Is
it in the working memory?
at
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:93)
at
packageDrlTest.Rule_incrementation_0.consequence(Rule_incrementation_0.java:9)
at
packageDrlTest.Rule_incrementation_0ConsequenceInvoker.evaluate(Rule_incrementation_0ConsequenceInvoker.java:22)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:545)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:509)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:430)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:392)
--
View this message in context: http://www.nabble.com/Update-error%3A-handle-not-found-for-object-tf42063...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 4 months
High Performance Rules Environment
by Robert Mertens
I would be interested in any feedback from users who have used / are using
the JBoss Rules engine in a high performance environment.
In order to justify the use of JBoss Rules / Drools, I need to be able to
reference implementations that are using this rule engine in a production
environment.
The BRMS components that form part of release 4.0 allow it to be evaluated
alongside Ilog Rules and Blaze Advisor; however, I really need some case
studies that detail the numbers of facts and rules that are in production
use, and any related stability issues.
To date, I have come across the following links :
http://legacy.drools.codehaus.org/Testimonies
http://lists.jboss.org/pipermail/rules-users/2007-July/002097.html
http://geekswithblogs.net/cyoung/articles/54022.aspx - Microsoft's Rule
Engine Scalability Results - A comparison with Jess and Drools
Does anybody know of any links to case studies, or performance /scalability
tests?
Thanks
17 years, 4 months
Inheritance
by Heyns, Juan
If I have two objects asserted into working memory and the one is
inherited from the other will a rule such as the following fire on both
objects (Person and Employee):
Rule
When
Person( property == "bla" )
Then
[...]
End
Juan
"Employees of Lonmin Platinum ("Lonplats") are not authorised to conclude
electronic transactions or to enter into electronic agreements on behalf
of Lonplats. Any electronic signature (other than an advanced electronic
signature as defined in the Electronic Communications and Transactions
Act of 2003) added to a data message (such as an email or an attachment
to an (email) ostensibly on behalf of Lonplats by a Lonplats employee shall
not be legally binding on Lonplats and Lonplats shall incur no liability of
any nature whatsoever, directly or indirectly, arising from such act on the
part of it's employee. It is further recorded that nothing (other than an
advanced electronic signature) inserted into any data message
emanating from Lonplats shall be construed as constituting an electronic
signature"
17 years, 4 months
Re: [rules-users] nested accessors with Sets
by mark.mcnally@comcast.net
Actually, it is still broken.
This does not complain but it always executes the consequence, even when the stateLicensures includes the state that in patientDetails.state
$ca:CandidateAssociation(nurseDetails.stateLicensures not contains patientDetails.state )
I also tried the following but it complains with an Exception
$ca:CandidateAssignment(participantDetails.state not memberof nurseDetails.stateLicensures )
org.drools.rule.InvalidRulePackage: [13,50]: unknown:13:50 Unexpected token 'not'[13,93]: unknown:13:93 mismatched token: [@98,574:574=')',<13>,13:93]; expecting type LEFT_PAREN
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
Is what I am trying to do supported by Drools?
Thank you,
Mark
-------------- Original message ----------------------
From: mark.mcnally(a)comcast.net
> My rule now appears to be working after switching from the "excludes" operator
> to the newer "not contains".
>
> This works:
> $ca:CandidateAssociation(nurseDetails.stateLicensures not contains
> patientDetails.state )
>
> This does not:
> $ca:CandidateAssociation(nurseDetails.stateLicensures excludes
> patientDetails.state )
>
>
> Mark
>
> -------------- Original message ----------------------
> From: mark.mcnally(a)comcast.net
> > Hello,
> >
> > Please excuse me if I have double posted - my first did not seem to appear.
> >
> > I am wondering if the following is valid rule syntax. I am getting a
> stacktrace
> > when the rules fire that points to a ClassCastException on a HashSet
> >
> > I am using v4.0 GA.
> >
> > Thank you, Mark
> >
> >
> > rule StateMatch
> > when
> > $ca:CandidateAssociation(nurseDetails.stateLicensures excludes
> > patientDetails.state )
> > then
> > retract( $ca );
> > end
> >
> >
> > public class CandidateAssociation {
> > private PatientDetails patientDetails;
> > private NurseDetails nurseDetails;
> > private int overlapHours;
> >
> > public CandidateAssociation( PatientDetails patientDetails, NurseDetails
> > nurseDetails) {
> > super();
> > this.patientDetails = patientDetails;
> > this.nurseDetails = nurseDetails;
> > overlapHours =
> > participantDetails.getNumberOverlapHourCnt(nurseDetails);
> > }
> > [...]
> > }
> >
> > public class NurseDetails {
> > private Set stateLicensures = new HashSet();
> > [...]
> > }
> > public class PatientDetails {
> > private String state;
> > [...]
> > }
> >
> > ------------------------------------------------------
> > Firing Rules
> > **********
> > org.drools.RuntimeDroolsException: Exception executing predicate
> > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > at
> >
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> > ctSinkAdapter.java:317)
> > at
> > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > at
> > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > at
> > org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> > at
> > org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> > ializeCandidateForEachNurse_0.java:13)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > at
> > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 403)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 384)
> > at
> > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > Caused by: java.lang.ClassCastException: java.util.HashSet
> > at
> >
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> > va:35)
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> > ... 17 more
> > org.drools.RuntimeDroolsException: Exception executing predicate
> > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > at
> >
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> > ctSinkAdapter.java:317)
> > at
> > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > at
> > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > at
> > org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> > at
> > org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> > ializeCandidateForEachNurse_0.java:13)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > at
> > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> > at
> >
> org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4
> > 30)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 412)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 384)
> > at
> > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > Caused by: java.lang.ClassCastException: java.util.HashSet
> > at
> >
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> > va:35)
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> > ... 18 more
> > Exception in thread "main" org.drools.spi.ConsequenceException:
> > org.drools.RuntimeDroolsException: Exception executing predicate
> > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > at
> > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:507)
> > at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> > at
> >
> org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4
> > 30)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 412)
> > at
> >
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> > 384)
> > at
> > primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> > at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> > Caused by: org.drools.RuntimeDroolsException: Exception executing predicate
> > org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> > at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> > at
> >
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> > ctSinkAdapter.java:317)
> > at
> > org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> > at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> > at
> > org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> > at
> > org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> > at
> > org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> > at
> > org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> > ializeCandidateForEachNurse_0.java:13)
> > at
> >
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> > luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> > at
> > org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> > ... 6 more
> > Caused by: java.lang.ClassCastException: java.util.HashSet
> > at
> >
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> > va:35)
> > at
> > org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> > ... 18 more
> > _______________________________________________
> > 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
17 years, 4 months