See below.<br><br><div class="gmail_quote">On 21 August 2012 21:05, dxande6 <span dir="ltr"><<a href="mailto:dxande6@qwest.com" target="_blank">dxande6@qwest.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm upgrading to Drools 5.4 from Drools 5.0.1. When I try to compile the<br>
.drl files into a .pkg I'm getting a couple of strange errors. Hoping<br>
someone can help.<br>
<br>
Here is the .drl<br>
<br>
rule "Rule 1 - Testing"<br>
no-loop true<br>
when<br>
$orderInfo : OrderingInfo (orderedProducts != null)<br>
then<br>
Customer customer = $orderInfo.getCustomer();<br>
ArrayList<ProductAttribute> productAttributes =<br>
$orderInfo.getAttributes();<br>
String localCode = getCode();<br>
end<br>
<br>
<br>
function String getCode (Customer customer) {<br>
return customer.getCode();<br>
}<br>
<br>
<br>
I get an error when I try to compile saying the following:<br>
Unable to resolve type ArrayList<ProductAttribute><br>
If I remove the line and just use ArrayList and leave off the<br>
"<ProductAttribute>" component, it works.<br>
Any help is appreciated.<br></blockquote><div><br>The DRL parser does not recognize generics. Omit "<...>".<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
It also cannot access the getCode() function.<br>
I'm not sure why that is the case.<br></blockquote><div><br>The function getCode() requires an argument. And (I think) its definition should precede its references.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Finally, I can get all of these things to work when I run the rules using<br>
the .DRL files. Typically we compile them into packages prior to<br>
deployment.<br></blockquote><div><br>Not sure what you mean here. If it doesn't compile, you can't "run" it.<br><br>-W<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thank you again in advance for any/all of your help.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-Upgrade-to-5-4-tp4019321.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Upgrade-to-5-4-tp4019321.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>