[jboss-jira] [JBoss JIRA] Created: (JBRULES-1439) Property Name inconsistent on RHS
greywind (JIRA)
jira-events at lists.jboss.org
Mon Jan 28 06:12:21 EST 2008
Property Name inconsistent on RHS
---------------------------------
Key: JBRULES-1439
URL: http://jira.jboss.com/jira/browse/JBRULES-1439
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.4
Reporter: greywind
Priority: Minor
I apologize right from the start if this is a know thing, but I couldn't find it in the Documentation or the mailing Lists:
public class Settlement
{
public String InstrumentType,InstrumentName;
public String getInstrumentType() {
return InstrumentType;
}
public void setInstrumentType(String instrumentType) {
InstrumentType = instrumentType;
}
public String getInstrumentName() {
return InstrumentName;
}
public void setInstrumentName(String instrumentName) {
InstrumentName = instrumentName;
}
}
The following Role leads to an error during compilation as the Property instrumentName can not be found on the RHS. in the LHS it is found:
rule "TestEntity"
//dialect "mvel"
when
$s : Settlement(instrumentType == "BOND", name : instrumentName)
#conditions
then
System.out.println("Found: " + $s.instrumentName);
end
It seems that in the java dialect the LHS follows java bean notation (property start with lower case) on the RHS not. I have to specify the property with UpperCamelCase on RHS to make it work:
rule "TestEntity"
//dialect "mvel"
when
$s : Settlement(instrumentType == "BOND", name : instrumentName)
#conditions
then
System.out.println("Found: " + $s.InstrumentName);
end
the MVEL dialect on the other hand handles this as expected. the property is LowerCamelCase on both sides:
rule "TestEntity"
dialect "mvel"
when
$s : Settlement(instrumentType == "BOND", name : instrumentName)
#conditions
then
System.out.println("Found: " + $s.instrumentName);
end
I would expect that the java dialect should work the same way here, should it not?
--
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