KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need a little help with Drools eval and variable assigning. rule "check that no previously submitted requests exist" when $user : UserFormField( name == 'employeeId', value != null ) $repository : Repository( ) $activeRequests : List( ) from $repository.findActiveRequestsByEmployee( $user.getValue() ) # call to repository eval( $activeRequests.size() > 0 ) then System.err.println(' You have active requests: ' + ((Request)$activeRequests.get(0)).getTitle); insert(Boolean.TRUE); end In this rule I try to access repository and get active requests for current user. Rule compiles and executes without any exceptions or warnings. In debug mode it can be seen that repository returns non empty list and I expect to see console message 'You have active requests' but this doesn't happen. I think the problem is in this line $activeRequests : List( ) from $repository.findActiveRequestsByEmployee( $user.getValue() ) because this rule works fine 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 could someone point me how to solve this problem? Thanks!
Tags (comma-separated)
Save Edits
Cancel