[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1439) Property Name inconsistent on RHS
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Wed Mar 12 08:12:58 EDT 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1439?page=comments#action_12402404 ]
Mark Proctor commented on JBRULES-1439:
---------------------------------------
The java dialect is the java language, there are no plans to start augmenting the java language beyond what is supported in the janino and jdt core compilers. It's messy unmaintainable work. If you want accessor support you can try lobbying those compiler maintainers as any enhancements they add will be exposed in our consequence.
> 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
> Assigned To: Mark Proctor
> 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