Forgive me if this one comes through a second time but I seem to be having a few difficulties getting my mails to go through.<br><span class="gmail_quote"><br></span>Hi Guys,<br><br>I&#39;ve decided to bite the bullet and try and move up to 
4.01 but I&#39;m having trouble getting the rules to compile. I have the following drl<br><br>/*******************<br>Code type rules<br>********************/
<br>package au.com.codeprotechnology.online.ejb3.logic.common<br><br>import au.com.codeprotechnology.online.bi.exception.ValidationError<br>import au.com.codeprotechnology.online.ejb3.logic.constants.CodeTypeConstants<br>

import au.com.codeprotechnology.online.persistence.ejb.core.CodeType<br><br>expander common.dsl<br><br>rule &quot;Code type is mandatory&quot;<br><br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The code types type is null or empty<br>&nbsp;&nbsp;&nbsp; then<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send the message that the code types type is mandatory<br>end<br><br>rule &quot;Long name is mandatory&quot;<br><br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The code types long name is null or empty<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send the message that the code types long name is mandatory
<br><br>end<br><br>rule &quot;Short name is mandatory&quot;<br><br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The code types short name is null or empty<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send the message that the code types short name is mandatory<br><br>

end<br><br>rule &quot;Short name too long&quot;<br><br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The short name for the code type is too long<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send the message that the code types short name is too long<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>end
<br><br>rule &quot;Sort order is mandatory&quot;<br><br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The code types sort order is null or zero<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send the message that the code types sort order is mandatory<br><br>end<br><br>
<br>
With the corresponding dsl<br><br>#Common domain specific language.<br>[when]The code types type=$obj : CodeType(val : codeType)<br>[when]The code types long name=$obj : CodeType(val : longName)<br>[when]The code types short name=$obj : CodeType(val : shortName)
<br>[when]The short name for the code type is too long=$obj : CodeType(val : shortName -&gt; (val != null &amp;&amp; val.trim().length() &gt; CodeTypeConstants.MAX_SHORT_NAME_LENGTH))<br>[when]The code types sort order=$obj : CodeType(val : sortOrder)
<br>[when]The documentation text=$obj : Documentation(val : documentationText)<br>[when]The documentation type is null=$obj : Documentation(val : type -&gt; (val == null))<br>[when]is null or empty=eval(val == null || val.trim

().length() == 0);<br>[when]is null or zero=eval(val == null || val.longValue() == 0);<br>[when]is not null=eval($obj != null);<br>[when]is not numeric=eval(!isNumeric(val));<br>[when]is not a valid expiry date=eval(!isValidExpiry(val));
<br>[when]length is greater than {len}=eval(val.length() &gt; {len});<br>[when]length is less than {len}=eval(val.length() &lt; {len});<br>[then]Print the message &#39;{msg}&#39;=System.out.println(&quot;{msg}&quot;);<br>

[then]Send the message that the code types type is mandatory=$obj.addValidationError(new ValidationError(CodeTypeConstants.MSG_KEY_CODE_TYPE_MANDATORY,CodeTypeConstants.MSG_CODE_TYPE_MANDATORY));<br>[then]Send the message that the code types long name is mandatory=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_LONG_NAME_MANDATORY,CodeTypeConstants.MSG_LONG_NAME_MANDATORY));<br>[then]Send the message that the code types short name is mandatory=$obj.addValidationError(new ValidationError(CodeTypeConstants.MSG_KEY_SHORT_NAME_MANDATORY

,CodeTypeConstants.MSG_SHORT_NAME_MANDATORY));<br>[then]Send the message that the code types short name is too long=$obj.addValidationError(new ValidationError(CodeTypeConstants.MSG_KEY_SHORT_NAME_TOO_LONG,CodeTypeConstants.MSG_SHORT_NAME_TOO_LONG

));<br>[then]Send the message that the code types sort order is mandatory=$obj.addValidationError(new ValidationError(CodeTypeConstants.MSG_KEY_SORT_ORDER_MANDATORY,CodeTypeConstants.MSG_SORT_ORDER_MANDATORY));<br>[then]Send the message that the documentation text is mandatory=$obj.addValidationError(new ValidationError(
DocumentationConstants.MSG_KEY_TEXT_MANDATORY,DocumentationConstants.MSG_TEXT_MANDATORY));<br>[then]Send the message that the documentation type is mandatory=$obj.addValidationError(new ValidationError(DocumentationConstants.MSG_KEY_TYPE_MANDATORY

,DocumentationConstants.MSG_TYPE_MANDATORY));<br><br>But I keep getting the following errors when trying to build the package<br><br>unknown:14:36 Unexpected token &#39;val&#39;<br>unknown:14:60 Unexpected token &#39;)&#39;
<br>unknown:14:61 Unexpected token &#39;.&#39;<br>unknown:14:71 mismatched token: [@106,457:458=&#39;==&#39;,&lt;75&gt;,14:71]; expecting type THEN<br>unknown:23:36 Unexpected token &#39;val&#39;<br>unknown:23:60 Unexpected token &#39;)&#39;
<br>unknown:23:61 Unexpected token &#39;.&#39;<br>unknown:23:71 mismatched token: [@171,723:724=&#39;==&#39;,&lt;75&gt;,23:71]; expecting type THEN<br>unknown:33:37 Unexpected token &#39;val&#39;<br>unknown:33:61 Unexpected token &#39;)&#39;
<br>unknown:33:62 Unexpected token &#39;.&#39;<br>unknown:33:72 mismatched token: [@236,995:996=&#39;==&#39;,&lt;75&gt;,33:72]; expecting type THEN<br>unknown:53:37 Unexpected token &#39;val&#39;<br>unknown:53:66 Unexpected token &#39;)&#39;
<br>unknown:53:68 Unexpected token &#39;==&#39;<br><br>These are the errors from PackageBuilder. Used to work fine with 3 and I can&#39;t see any drastic differences between this and your examples in the documentation.<br>

<br><br><br>