[jboss-jira] [JBoss JIRA] Created: (JBRULES-1944) Adding crontab type functionality for repetitive rules.

Griz frf (JIRA) jira-events at lists.jboss.org
Sun Jan 25 12:08:44 EST 2009


Adding crontab type functionality for repetitive rules.
-------------------------------------------------------

                 Key: JBRULES-1944
                 URL: https://jira.jboss.org/jira/browse/JBRULES-1944
             Project: JBoss 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