[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1944) Adding crontab type functionality for repetitive rules.
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Sun Nov 29 23:27:29 EST 2009
[ https://jira.jboss.org/jira/browse/JBRULES-1944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12497103#action_12497103 ]
Mark Proctor commented on JBRULES-1944:
---------------------------------------
Just added in a basic cron support for triggers. Will now try and hook this up to managed activations, so if the rule is true it will re-active after firing based on the cron definition of the rule attribute.
Cron isn't quite the same as duration, as cron fires on fixed points of time instead of after a given duration. Ideas on how we can align the two better, would be appreciated.
> Adding crontab type functionality for repetitive rules.
> -------------------------------------------------------
>
> Key: JBRULES-1944
> URL: https://jira.jboss.org/jira/browse/JBRULES-1944
> Project: Drools
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: drools-api
> Affects Versions: FUTURE
> Reporter: Griz frf
> Assignee: Mark Proctor
>
> A convinient helper function to schedule rule executions in a similar manner to the cron utility would be useful.
> My specific use case is for a long running session to periodically write out data to a persistence store (db, file, etc)
> The current code for this is as follows :
> rule "DBpoll"
> duration(30s)
> when $d:String(toString=="Run")
> then
> System.out.println("30seconds elapsed");
> Database.dosomething();
> modify($d){};
> end
> --------------------------------
> session.insert(new String("Run"));
> ---------------------------------
> While this method does work, it requires the external dummy object trigger. In dynamically generated rules and rules pulled in from libraries, etc (not under the current developers control) it is difficult to ensure that a suibtable trigger is available.
> Therefore a cron like function would solve this issue.
> I envision the EVERY keyword and possibly a COUNT or for loop style format
> rule "DBpoll"
> EVERY(30s, 100) <-- means every 30 seconds for 100 iterations. or EVERY(30s, 10m) <-- every 30 seconds for 10 mins
> then
> System.out.println("30seconds elapsed");
> Database.dosomething();
> end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list