<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Yes here is the full thing.<br><br>function List doEventCodesExist( Submission submission, EntityManager entityManager )<br>{<br> return SubmissionReviewRulesActionHelper.checkIfEventCodesExist( submission, entityManager );<br>}<br><br>rule "SECOND Event Codes must not exist - EPC"<br>// 4(2)<br> when<br> $event: Event( );<br> $submission: Submission( );<br> $entityManager : EntityManager( );<br> $changedEventCodes : List( ) from doEventCodesExist( $submission, $entityManager );<br> eval( $changedEventCodes.size() > 0 );<br> then<br>
$event.addReviewIssue( new ReviewIssue( $event, $submission, SubmissionReviewConstants.SUBMISSION,<br> ReviewCriticality.CRITICAL, SectionFiltersEnum.SUBMISSION,<br> $changedEventCodes + " submissionReview.submission.eventCodesAlreadyExist" ) );<br>end<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Mark Proctor <mproctor@codehaus.org><br>To: Rules Users List <rules-users@lists.jboss.org><br>Sent: Friday, August 15, 2008 1:29:16 PM<br>Subject: Re: [rules-users] How do I assign a local variable from a function call?<br><br>
Did you try adding types to your functions like the documentation says?<br>
<br>
samd wrote:
<blockquote type="cite">
<pre>Nobody knows?<br><br><br>samd wrote:<br> </pre>
<blockquote type="cite">
<pre>All I want to do is something simple like the following:<br><br>$changedList: java.util.List( ) from getChangedList( $x, $y );<br><br>Then in the same .drl file a function something like:<br><br>function List getChangedList( $x, $y )<br>{<br> return JavaClass.staticDoSomethingToGetListMethod( $x, $y);<br>}<br><br>I have tried doing this and I get:<br><br>Unable to build expression for 'from' node 'getChangedList( $x, $y)'<br><br>It looks like there is supposed to be something in between the from and<br>the function? I have been looking for examples for something like this and<br>have not found any.<br><br>Thanks<br><br> </pre>
</blockquote>
<pre> </pre>
</blockquote>
<br>
</div></div></div></body></html>