[rules-users] Drools Upgrade to 5.4

Wolfgang Laun wolfgang.laun at gmail.com
Tue Aug 21 15:18:55 EDT 2012


See below.

On 21 August 2012 21:05, dxande6 <dxande6 at qwest.com> wrote:

> I'm upgrading to Drools 5.4 from Drools 5.0.1.  When I try to compile the
> .drl files into a .pkg I'm getting a couple of strange errors.  Hoping
> someone can help.
>
> Here is the .drl
>
> rule "Rule 1 - Testing"
> no-loop true
>         when
>                 $orderInfo : OrderingInfo (orderedProducts != null)
>         then
>                 Customer customer = $orderInfo.getCustomer();
>                 ArrayList<ProductAttribute> productAttributes =
> $orderInfo.getAttributes();
>                 String localCode = getCode();
> end
>
>
> function String getCode (Customer customer) {
>         return customer.getCode();
> }
>
>
> I get an error when I try to compile saying the following:
>     Unable to resolve type ArrayList<ProductAttribute>
>     If I remove the line and just use ArrayList and leave off the
> "<ProductAttribute>" component, it works.
>     Any help is appreciated.
>

The DRL parser does not recognize generics. Omit "<...>".



>
> It also cannot access the getCode() function.
>     I'm not sure why that is the case.
>

The function getCode() requires an argument. And (I think) its definition
should precede its references.


>
> Finally, I can get all of these things to work when I run the rules using
> the .DRL files.  Typically we compile them into packages prior to
> deployment.
>

Not sure what you mean here. If it doesn't compile, you can't "run" it.

-W


>
> Thank you again in advance for any/all of your help.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Upgrade-to-5-4-tp4019321.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> 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/20120821/c42e6bba/attachment.html 


More information about the rules-users mailing list