Hi Devyani,

You might have problems with the date format due to your system's settings. There's the following remark in Drools 4 documentation:
Date

The date format "dd-mmm-yyyy" is supported by default. You can customize this by providing an alternative date format mask as a System property ("drools.dateformat" is the name of the property). If more control is required, use the inline-eval constraint.

The best thing is to set that system property to the exact format you want to use. Something like this:

System.setProperty("drools.dateformat", "dd-mmm-yyyy hh:mm");

--

I believe, that date-effective will simply check the system time before firing a rule and, if the current time is before the specified time in the rule, it won't fire the rule.

AFAIK, you can't make a rule be triggered at a certain time everyday, except if you insert at that specified time a fact (or a set of facts) that will make that rule fire..

Leo Gomes.


2010/9/29 <devyani.sapre@wipro.com>
Hi All
 
I am using 4.0. I have a requirement to execute a rule only during a specified time of a given day
 
While going through the documentation I found that I could use the date-effective attribute to specify the date and time
 

6.5.1.8. date-effective

default value : N/A

type : String, which contains a Date/Time definition

A rule can only activate if the current date and time is after date-effective attribute.

But while trying out the same, the engine recognizes only the day and not the time. How do I specify the time? So far I have been using the std format HH:MM:SS , tried both 12-hr and 24 -hr format but no luck. Please help.

Also, I would like to know how can I make a rule run on a specified time everyday. With date-effective specifying a date would be mandatory? Is thr a way or I need to put that in the rule condition part.

 

Thanks

Devyani

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users