[rules-users] How do I assign a local variable from a function call?

samd sdoyle_2 at yahoo.com
Fri Aug 15 15:32:15 EDT 2008


Looks like this doesn't work in the 'when' portion.


Scott Burrows wrote:
> 
> We do this....
> rule "Transaction"
>     salience 9000
>     no-loop true
>     when
>     then
>            CardTranResponse respObj = new     CardTranResponse();
> 
>            respObj = handleTransaction($currcode, c1, t1,
> $limit_amount_fees,
>                                                       $tot_feedeny,
> "Transaction permitted", respObj);
> 
> end;
> 
> 
> Scott
> 
> 
> On Fri, Aug 15, 2008 at 12:53 PM, samd <sdoyle_2 at yahoo.com> wrote:
> 
>>
>> Nobody knows?
>>
>>
>> samd wrote:
>> >
>> > All I want to do is something simple like the following:
>> >
>> > $changedList: java.util.List( ) from getChangedList( $x, $y );
>> >
>> > Then in the same .drl file a function something like:
>> >
>> > function List getChangedList( $x, $y )
>> > {
>> >     return JavaClass.staticDoSomethingToGetListMethod( $x, $y);
>> > }
>> >
>> > I have tried doing this and I get:
>> >
>> > Unable to build expression for 'from' node 'getChangedList( $x, $y)'
>> >
>> > It looks like there is supposed to be something in between the from and
>> > the function? I have been looking for examples for something like this
>> and
>> > have not found any.
>> >
>> > Thanks
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-do-I-assign-a-local-variable-from-a-function-call--tp18987041p19002039.html
>> Sent from the drools - user mailing list archive at Nabble.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
> 
> 

-- 
View this message in context: http://www.nabble.com/How-do-I-assign-a-local-variable-from-a-function-call--tp18987041p19004314.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list