[rules-users] Specifying time in date-effective

Michael Anstis michael.anstis at gmail.com
Wed Sep 29 05:13:27 EDT 2010


I am unfamiliar with the "date-effective" attribute so will not comment.

However, regarding getting a rule to run on a specified time every day, I
would suggest use of an external scheduler (Windows Task Scheduler, CRON,
Quartz etc) that invokes a process to trigger execution of the activations
on the agenda (i.e. fireAllRules) at the specified time every day. It is
important to remember that Rule activations are determined when Facts are
inserted into WorkingMemory. The activations collect on the agenda and are
executed when fireAllRules() is invoked. So you *could* perform your
WorkingMemory actions (insert, update, retract etc) throughout the day and
only trigger the resulting actions when you want.

If any of your Rules match temporal patterns you might be better moving to
5.1 and leveraging it's CEP facilities.

It is difficult to say much more without understanding what you are trying
to achieve.

With kind regards,

Mike

2010/9/29 <devyani.sapre at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100929/bad411fa/attachment.html 


More information about the rules-users mailing list