[rules-users] How to get a rule fired when the object is not changed?

Mark Proctor mproctor at codehaus.org
Tue Jan 16 09:59:15 EST 2007


Have you thought of combining a  control fact or field with the duration 
attribute?

Mark
Faizan wrote:
> My Fact/object (order) has multiple attributes and "due date" is one of
> them. A single rule is based on a combination of more than one attribute. My
> rule's when condition are dynamic and configurable by the end-user. An
> example of a rule's condition could be:
> when
>        Order(dueDate < (some date), quantity > 1000)
> then
>       //do something
>
> Dynamic rule here means that "some date" could be the current-date or it
> could be current-date + 2 days i.e configurable. The thread I'm talking
> about runs once a day to check the the due date condition.
> Now the problem is that if the object is not changed and we call
> fireAllRules() then even if the duedate condition is met then too the rule
> is not fired because the object is not changed.
>
>
>
> Michael Suzio wrote:
>   
>> Why couldn't the object itself know when the due date has passed?  If you
>> kept calling fireAllRules periodically in a thread, and had a rule like:
>>
>> when
>>   Order (dueDatePassed == true)
>> then
>>  // do something
>> end
>>
>> Then you just need a isDueDatePassed method in the Order object, which
>> itself compares the due date to the current time.
>>
>>     
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070116/76b8a22d/attachment.html 


More information about the rules-users mailing list