[rules-users] How to use contains with a function

Hezi Stern hezis at delegatecom.com
Wed Nov 23 10:51:09 EST 2011


Hi all,

 

I encountered the following issue:

 

As an example TaskConectxt() holds a list of time related objects called
times. 

I would like to write a rule which ideally would filter the TaskContext
according  to a specific time object.

The problematic restriction is that this time object is derived using a
helper function (imported), in this case called getTimeByID which received
as input an enum ID of a time and returns the desired time object.

 

Ideally the rule would like something like this: 

 

rule "verify time"

      when

            

            $tc:                    TaskContext(times contains
getTimeByID(ETimeID.NOW))

      then

            //something 

end

 

unfortunately this does not work. 

Is there any way to call a function with a param?

Is there a better alternative method than this one?

 

Thanks,

Hezi

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111123/29650a00/attachment.html 


More information about the rules-users mailing list