[rules-users] FW: FW: Capitalized element names

Wolfgang Laun wolfgang.laun at gmail.com
Thu Jul 28 01:17:44 EDT 2011


As far as I can tell, the expression must contain '||' for the error to
occur, and 'in' is just syntactic sugar for a disjunction.

Added this insight to JBRULES-3147<https://issues.jboss.org/browse/JBRULES-3147>

Thanks
-W

2011/7/27 <Tom.E.Murphy at wellsfargo.com>

> Thanks, Wolfgang.****
>
> ** **
>
> Is it possible the error is in the internal treatment of caps in the code
> that converts ****
>
> ** **
>
> MICompanyMarketClassification in (“2”, “3”) ****
>
> to ****
>
> MICompanyMarketClassification == “2” || MICompanyMarketClassification ==
> “3”****
>
> ** **
>
> Why I think this: ****
>
> ** **
>
> The only place the capitalization seems harmful is when it occurs with an
> in (…) clause.****
>
> ** **
>
> If I use forced lower- casing of the first letter of a capitalized property
> in other types of expressions, 5.2 fails. ****
>
> If I use forced lower-casing of the first letter of a capitalized property
> in an in(…) expression, 5.2 succeeds.****
>
> If I use natural casing of a capitalized property in other types of
> expressions, 5.2 succeeds.****
>
> If I use natural casing of a capitalized property in property in an in(…)
> expression, 5.2 fails.****
>
> ** **
>
> ** **
>
> *Tom Murphy*
>
> Systems Architect
> Wells Fargo HCFG - CORE Deal Decisioning Platform
>
>
>
> 800 S. Jordan Creek Parkway | West Des Moines, IA 50266
> MAC: X2301-01B*
> *Office: 515 324 4853 | Mobile: 515 423 4334
>
> tom.e.murphy at wellsfargo.com
>
> This transmission may contain information that is confidential and/or
> proprietary. If you are not the individual or entity to which it is
> addressed, note that any review, disclosure, copying, retransmission, or
> other use is strictly prohibited. If you received this transmission in
> error, please notify the sender immediately and delete the material from
> your system.****
>
> ** **
>
> ** **
>
> *From:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *On Behalf Of *Wolfgang Laun
> *Sent:* Wednesday, July 27, 2011 12:46 AM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] FW: Capitalized element names****
>
> ** **
>
> Edson,
>
> please also not JBRULES-3147: Regression: all uppercase field reference
> results in compile error. Some forms used to work in 5.1.1 that don't in
> 5.2.
>
> I've added the gist of this thread to JIRA-3147.
>
> -W
>
>
> 2011/7/27 Edson Tirelli <ed.tirelli at gmail.com>
> >
> >    If one works and the other doesn't, then we have a problem. It must
> work if you make the first letter lowercase, as that is part of the
> javabeans spec.
> >    Feel free to open a JIRA and we will take a look at it.
> >    Edson
> >
> > 2011/7/26 <Tom.E.Murphy at wellsfargo.com>
> >>
> >> Thanks Edson, however here is more info on the issue as I’ve been
> playing with it:
> >>
> >> 1.       I have other elements in other objects referenced within the
> same rule group that start with capital letters and they have no problem.
> Example:
> >>
> >> , FHAMaxBaseMortgageWithToleranceAmt <
> ($totalLoanAmt+$aggregateSubordinateFinancingAmt)
> >>
> >> Compiles just fine in the same session.
> >>
> >> 2.       If I lower the first M to m to make it
> mICompanyMarketClassification, it compiles in 5.2 but does NOT compile in
> 5.0.1
> >>
> >> 3.       If I leave it as the capitalized MICompanyMarketClassification,
> it compiles in 5.0.1 but not 5.2
> >>
> >> Thoughts?
> >>
> >> Tom Murphy
> >>
> >> Systems Architect
> >> Wells Fargo HCFG - CORE Deal Decisioning Platform
> >>
> >>
> >>
> >> 800 S. Jordan Creek Parkway | West Des Moines, IA 50266
> >> MAC: X2301-01B
> >> Office: 515 324 4853 | Mobile: 515 423 4334
> >>
> >> tom.e.murphy at wellsfargo.com
> >>
> >> This transmission may contain information that is confidential and/or
> proprietary. If you are not the individual or entity to which it is
> addressed, note that any review, disclosure, copying, retransmission, or
> other use is strictly prohibited. If you received this transmission in
> error, please notify the sender immediately and delete the material from
> your system.
> >>
> >>
> >>
> >>
> >>
> >> From: rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] On Behalf Of Edson Tirelli
> >> Sent: Tuesday, July 26, 2011 7:45 PM
> >> To: Rules Users List
> >> Subject: Re: [rules-users] Capitalized element names
> >>
> >>
> >>
> >>
> >>
> >>    Hi Tom,
> >>
> >>
> >>
> >>    I've seen this before and AFAIK, the javaBeans spec always transforms
> the first letter to lowercase when converting a get method into a property
> name. We can try to address this in future releases, maybe falling back to
> uppercase if the lower case property name lookup fails, but I don't think
> there is a solution to keep it as is. In 5.2. you can use the full method
> name instead, but not sure if that isn't event worse:
> >>
> >>
> >>
> >>                 MortageInsurance{ getMICompanyMarketClassification() in
> (“2”, “3”) }
> >>
> >>
> >>
> >>      Edson
> >>
> >>
> >>
> >> 2011/7/26 <Tom.E.Murphy at wellsfargo.com>
> >>
> >> In the following rule, the element MICompanyMarketClassification is
> capitalized due to the MI portion being an acronym for Mortgage Insurance.
> >>
> >> This comes from our enterprise data model and is not something I can
> change.
> >>
> >>
> >>
> >> rule “R1234”
> >>
> >>         dialect “java”
> >>
> >>         when
> >>
> >>                 MortageInsurance{ MICompanyMarketClassification in (“2”,
> “3”) }
> >>
> >>         then
> >>
> >>                 system.out.printLn(“something”);
> >>
> >> end
> >>
> >>
> >>
> >> The rule refuses to compile, giving a message “Unable to Analyse
> Expression MICompanyMarketClassification == "2" ||
> MICompanyMarketClassification == "3":
> >>
> >> [Error: no such identifier: MICompanyMarketClassification]
> >>
> >> [Near : {... MICompanyMarketClassification ....}]”
> >>
> >>
> >>
> >> I assume this is caused by the capitalized first letter?
> >>
> >> Anything I can do to fix the issue or work around it?
> >>
> >>
> >>
> >> Drools 5.2 community edition
> >>
> >> Tom Murphy
> >>
> >> Systems Architect
> >> Wells Fargo HCFG - CORE Deal Decisioning Platform
> >>
> >>
> >>
> >> 800 S. Jordan Creek Parkway | West Des Moines, IA 50266
> >> MAC: X2301-01B
> >> Office: 515 324 4853 | Mobile: 515 423 4334
> >>
> >> tom.e.murphy at wellsfargo.com
> >>
> >> This transmission may contain information that is confidential and/or
> proprietary. If you are not the individual or entity to which it is
> addressed, note that any review, disclosure, copying, retransmission, or
> other use is strictly prohibited. If you received this transmission in
> error, please notify the sender immediately and delete the material from
> your system.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >> --
> >>   Edson Tirelli
> >>   JBoss Drools Core Development
> >>   JBoss by Red Hat @ www.jboss.com
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> >   Edson Tirelli
> >   JBoss Drools Core Development
> >   JBoss by Red Hat @ www.jboss.com
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >****
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110728/47315221/attachment.html 


More information about the rules-users mailing list