[From nobody Fri Apr 20 09:04:57 2012 From: "Edson Tirelli" <tirelli@post.com> To: "Rules Users List" <rules-users@lists.jboss.org> Subject: Re: [rules-users] nested accessors with Sets Date: Thu, 2 Aug 2007 13:20:54 +0000 Content-Type: Multipart/mixed; boundary="NextPart_Webmail_9m3u9jl4l_23733_1186080781_1" --NextPart_Webmail_9m3u9jl4l_23733_1186080781_1 Content-Type: multipart/alternative; boundary="----=_Part_60765_10031497.1186060662541" ------=_Part_60765_10031497.1186060662541 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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@comcast.net <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@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@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@lists.jboss.org > > > https://lists.jboss.org/mailman/listinfo/rules-users > > > > _______________________________________________ > > rules-users mailing list > > rules-users@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-users > > _______________________________________________ > rules-users mailing list > rules-users@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 ------=_Part_60765_10031497.1186060662541 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <br>&nbsp;&nbsp; Mark,<br><br>&nbsp;&nbsp; Sorry for not answering before. I was doing some research. <br>&nbsp;&nbsp; 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:<br><br>&nbsp;&nbsp; $ca:CandidateAssociation( eval ( nurseDetails.stateLicensures not contains patientDetails.state&nbsp;&nbsp;) )<br><br>&nbsp;&nbsp;&nbsp; Problem is that &quot;not contains&quot; is not a valid operator for MVEL. May I ask you please to open a JIRA for that? I will fix it asap.<br> <br>&nbsp;&nbsp;&nbsp; Meanwhile, to work around the problem you can either avoid the accessor path expression when using &quot;contains/memberOf/matches&quot; 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: <br><br>rule XXX<br>&nbsp;&nbsp;&nbsp; dialect &quot;mvel&quot;<br>when<br>&nbsp;&nbsp; $ca:CandidateAssociation( eval ( ! nurseDetails.stateLicensures.contains( patientDetails.state ) ) )<br>then<br>&nbsp;&nbsp; // do something<br>end<br>&nbsp;<br>&nbsp; Please not that as you are explicitly declaring the mvel dialect for your rule, your consequence will also be an MVEL block. <br><br>&nbsp; Sorry for the inconvenience. I will fix that for 4.0.1.<br><br>&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/8/1, <a href="mailto:mark.mcnally@comcast.net">mark.mcnally@comcast.net</a> &lt; <a href="mailto:mark.mcnally@comcast.net">mark.mcnally@comcast.net</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Actually, it is still broken. <br><br>This does not complain but it always executes the consequence, even when the stateLicensures includes the state that in patientDetails.state<br><br>&nbsp;&nbsp; $ca:CandidateAssociation(nurseDetails.stateLicensures not contains patientDetails.state&nbsp;&nbsp;)<br><br><br>I also tried the following but it complains with an Exception<br><br>&nbsp;&nbsp;$ca:CandidateAssignment(participantDetails.state not memberof nurseDetails.stateLicensures&nbsp;&nbsp;)<br><br><br>org.drools.rule.InvalidRulePackage : [13,50]: unknown:13:50 Unexpected token &#39;not&#39;[13,93]: unknown:13:93 mismatched token: [@98,574:574=&#39;)&#39;,&lt;13&gt;,13:93]; expecting type LEFT_PAREN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.drools.rule.Package.checkValidity(Package.java :408)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)<br><br><br>Is what I am trying to do supported by Drools?<br><br>Thank you,<br>Mark<br><br><br> -------------- Original message ---------------------- <br>From: <a href="mailto:mark.mcnally@comcast.net">mark.mcnally@comcast.net</a><br>&gt; My rule now appears to be working after switching from the &quot;excludes&quot;&nbsp;&nbsp;operator<br>&gt; to the newer &quot;not contains&quot;. <br>&gt;<br>&gt; This works:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $ca:CandidateAssociation(nurseDetails.stateLicensures not contains<br>&gt; patientDetails.state&nbsp;&nbsp;)<br>&gt;<br>&gt; This does not:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $ca:CandidateAssociation(nurseDetails.stateLicensures excludes<br>&gt; patientDetails.state&nbsp;&nbsp;)<br>&gt;<br>&gt;<br>&gt; Mark<br>&gt;<br>&gt;&nbsp;&nbsp;-------------- Original message ----------------------<br>&gt; From: <a href="mailto:mark.mcnally@comcast.net">mark.mcnally@comcast.net </a><br>&gt; &gt; Hello,<br>&gt; &gt;<br>&gt; &gt; Please excuse me if I have double posted - my first did not seem to appear.<br>&gt; &gt;<br>&gt; &gt; I am wondering if the following is valid rule syntax. I am getting&nbsp;&nbsp;a <br>&gt; stacktrace<br>&gt; &gt; when the rules fire that points to a ClassCastException on a HashSet<br>&gt; &gt;<br>&gt; &gt; I am using v4.0 GA.<br>&gt; &gt;<br>&gt; &gt; Thank you, Mark<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; rule StateMatch <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; when<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; $ca:CandidateAssociation(nurseDetails.stateLicensures excludes<br>&gt; &gt; patientDetails.state&nbsp;&nbsp;)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; then<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retract( $ca );<br>&gt; &gt; end<br> &gt; &gt;<br>&gt; &gt;<br>&gt; &gt; public class CandidateAssociation {<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; private PatientDetails patientDetails;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; private NurseDetails&nbsp;&nbsp; nurseDetails;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; private int overlapHours; <br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; public CandidateAssociation( PatientDetails patientDetails, NurseDetails<br>&gt; &gt; nurseDetails) {<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super();<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.patientDetails = patientDetails; <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.nurseDetails = nurseDetails;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; overlapHours =<br>&gt; &gt; participantDetails.getNumberOverlapHourCnt(nurseDetails);<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt; [...]<br>&gt; &gt; } <br>&gt; &gt;<br>&gt; &gt; public class NurseDetails {<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; private Set stateLicensures = new HashSet();<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>&gt; &gt; }<br>&gt; &gt; public class PatientDetails {<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; private String state; <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>&gt; &gt; }<br>&gt; &gt;<br>&gt; &gt; ------------------------------------------------------<br>&gt; &gt; Firing Rules<br>&gt; &gt; **********<br>&gt; &gt; org.drools.RuntimeDroolsException: Exception executing predicate <br>&gt; &gt; org.drools.base.mvel.MVELPredicateExpression@27d6bfb<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.AlphaNode.assertObject (AlphaNode.java:121)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje<br>&gt; &gt; ctSinkAdapter.java:317)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ObjectTypeNode.assertObject (ObjectTypeNode.java:159)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt; org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init<br>&gt; &gt; ializeCandidateForEachNurse_0.java:13)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva <br>&gt; &gt; luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.common.DefaultAgenda.fireNextItem (DefaultAgenda.java:467)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:<br>&gt; &gt; 403)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:<br>&gt; &gt; 384)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java :91)<br>&gt; &gt; Caused by: java.lang.ClassCastException: java.util.HashSet<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja<br>&gt; &gt; va:35)<br> &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; ... 17 more<br>&gt; &gt; org.drools.RuntimeDroolsException: Exception executing predicate<br>&gt; &gt; org.drools.base.mvel.MVELPredicateExpression@27d6bfb<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.AlphaNode.assertObject (AlphaNode.java:121)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje<br>&gt; &gt; ctSinkAdapter.java:317)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ObjectTypeNode.assertObject (ObjectTypeNode.java:159)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt; org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br> &gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init<br>&gt; &gt; ializeCandidateForEachNurse_0.java:13)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva <br>&gt; &gt; luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.common.DefaultAgenda.fireNextItem (DefaultAgenda.java:467)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4<br>&gt; &gt; 30)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:<br>&gt; &gt; 412)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:<br>&gt; &gt; 384)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; primarynursePOC.PrimaryNursePOC.selectPrimaryNurse (PrimaryNursePOC.java:136)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)<br>&gt; &gt; Caused by: java.lang.ClassCastException: java.util.HashSet<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja<br>&gt; &gt; va:35)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; ... 18 more <br>&gt; &gt; Exception in thread &quot;main&quot; org.drools.spi.ConsequenceException:<br>&gt; &gt; org.drools.RuntimeDroolsException: Exception executing predicate<br>&gt; &gt; org.drools.base.mvel.MVELPredicateExpression@27d6bfb <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:507)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; <br>&gt; org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4<br>&gt; &gt; 30)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java :<br>&gt; &gt; 412)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:<br>&gt; &gt; 384)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; primarynursePOC.PrimaryNursePOC.selectPrimaryNurse (PrimaryNursePOC.java:136)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)<br>&gt; &gt; Caused by: org.drools.RuntimeDroolsException: Exception executing predicate<br>&gt; &gt; org.drools.base.mvel.MVELPredicateExpression@27d6bfb <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; <br>&gt; org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje<br>&gt; &gt; ctSinkAdapter.java:317)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java :159)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.reteoo.ReteooWorkingMemory.doInsert (ReteooWorkingMemory.java:70)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert( DefaultKnowledgeHelper.java:64)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence (Rule_Init<br>&gt; &gt; ializeCandidateForEachNurse_0.java:13)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt;<br>&gt; org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva<br>&gt; &gt; luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25) <br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; ... 6 more<br>&gt; &gt; Caused by: java.lang.ClassCastException: java.util.HashSet<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at <br>&gt; &gt;<br>&gt; org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja<br>&gt; &gt; va:35)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; at<br>&gt; &gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java :191)<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; ... 18 more<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rules-users mailing list<br>&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a> <br>&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list <br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br> _______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users"> https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646 <br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a> ------=_Part_60765_10031497.1186060662541-- --NextPart_Webmail_9m3u9jl4l_23733_1186080781_1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users --NextPart_Webmail_9m3u9jl4l_23733_1186080781_1-- ]