Child pages
  • scheduler

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE
Note
titleWhere is the method executed?

The scheduled methods are executed in the client in which they are started. This means that if the client is closed, the scheduled method(s) will not run anymore. See Batch Processors for information how to continuously run methods in the background, in a client that will not be closed (automatically)


HTML Table
classservoy sSummery
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summery
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addCronJob(jobname, cronTimings, globalMethod, [startDate], [endDate], [arguments])
Adds a cron job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobname, startDate, globalMethod, [repeatInterval(ms)], [repeatCount], [endDate], [arguments])
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getCurrentJobNames()
Returns an array with the current jobs.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getLastRunJobName()
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#removeJob(jobname)
Removes a job from the scheduler.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idaddCronJob
classnode
Table Row (tr)
idname
Table Cell (td)
addCronJob
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addCronJob
Span
stylefloat: left;
idiets
(jobname, cronTimings, globalMethod, [startDate], [endDate], [arguments])
Table Row (tr)
iddes
Table Cell (td)
Adds a cron job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
jobname
cronTimings
globalMethod
[startDate]
[endDate]
[arguments]
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// see: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more info
// add a job that runs every 20 minutes after the hour (0,20,40)
plugins.scheduler.addCronJob('20mins','0 0/20 * * * ?',globalMethod)
// add a job that runs every day at 23:30 between now and 5 days from now
var dateNow = new Date();
var date5Days = new Date(dateNow.getTime()+5*24*60*60*1000);
plugins.scheduler.addCronJob('23:30','0 30 23 ? * *',globalMethod,dateNow,date5Days)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob
classnode
Table Row (tr)
idname
Table Cell (td)
addJob
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addJob
Span
stylefloat: left;
idiets
(jobname, startDate, globalMethod, [repeatInterval(ms)], [repeatCount], [endDate], [arguments])
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
jobname
startDate
globalMethod
[repeatInterval(ms)]
[repeatCount]
[endDate]
[arguments]
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,globalMethod,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetCurrentJobNames
classnode
Table Row (tr)
idname
Table Cell (td)
getCurrentJobNames
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String[]
Span
stylefloat: left; font-weight: bold;
idiets
getCurrentJobNames
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns an array with the current jobs.
Table Row (tr)
idret
Table Cell (td)
Returns
String[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Returns an array of current jobnames
plugins.scheduler.getCurrentJobNames()
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetLastRunJobName
classnode
Table Row (tr)
idname
Table Cell (td)
getLastRunJobName
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getLastRunJobName
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Replace with description
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveJob
classnode
Table Row (tr)
idname
Table Cell (td)
removeJob
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
removeJob
Span
stylefloat: left;
idiets
(jobname)
Table Row (tr)
iddes
Table Cell (td)
Removes a job from the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
jobname
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// removes a job 'myjob' from the scheduler
plugins.scheduler.removeJob('myjob')
Table Row (tr)
classlastDetailRow
Table Cell (td)