[jboss-jira] [JBoss JIRA] Closed: (JBRULES-1058) nested accessors with Sets - "not contains" is not a valid operator for MVEL

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Wed Aug 22 09:10:19 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBRULES-1058?page=all ]

Edson Tirelli closed JBRULES-1058.
----------------------------------

    Resolution: Duplicate Issue

This is being handled as part of http://jira.jboss.com/jira/browse/JBRULES-1089

> nested accessors with Sets - "not contains" is not a valid operator for MVEL
> ----------------------------------------------------------------------------
>
>                 Key: JBRULES-1058
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1058
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Drl Parser/Builder
>    Affects Versions:  4.0.0.GA
>            Reporter: Mark McNally
>         Assigned To: Edson Tirelli
>             Fix For: 4.0.1
>
>
> Following does not work:
> 		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;
> 			[...]
> 		}
> Edson suggested that the problem is that "not contains" is not a valid operator for MVEL. 
> Also Noticed that the following workaround did not work:
> 		rule State
> 		    dialect "mvel"
> 			when
> 		            $ca:CandidateAssociation( eval ( ! nurseDetails.stateLicensures.contains( patientDetails.state ) ) )
> 			then 	
> 		  	    retract( $ca );
> 		end
> 		
> 		This produced 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 message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list