I need a little help with assigning Drools and a variable.
rule "check that no previously submitted requests exist" when $user : UserFormField( name == 'employeeId', value != null ) $repository : Repository( ) $activeRequests : List( ) from $repository.findActiveRequestsByEmployee( $user.getValue() )
In this rule, I try to access the repository and receive active requests for the current user. The rule is compiled and executed without any exceptions or warnings. In debug mode, you can see that the repository does not return an empty list, and I expect to see the console message "You have active requests", but this does not happen. I think the problem is in this line
$activeRequests : List( ) from $repository.findActiveRequestsByEmployee( $user.getValue() )
because this rule works great
rule "check that no previously submitted requests exist" when $user : UserFormField( name == 'employeeId', value != null ) $repository : Repository( ) eval( $repository.findActiveRequestsByEmployee($user.getValue()).size() > 0 ) then System.err.println(' You have active requests !' ); insert(Boolean.TRUE); end
So can someone tell me how to solve this problem?
Thanks!
drools
ATMTA
source share