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 sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addCronJob(jobname, cronTimings, method)
Adds a cron job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addCronJob(jobname, cronTimings, method, startDate)
Adds a cron job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addCronJob(jobname, cronTimings, method, startDate, endDate)
Adds a cron job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addCronJob(jobname, cronTimings, method, 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, method)
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobname, startDate, method, repeatInterval)
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobname, startDate, method, repeatInterval, repeatCount)
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobName, startDate, method, repeatInterval, repeatCount, endDate)
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobname, startDate, method, repeatInterval, repeatCount, endDate, arguments)
Adds a job to the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addJob(jobname, startDate, method, 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()
Returns the last job run from the scheduler.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
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-String_String_Function
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, method)
Table Row (tr)
iddes
Table Cell (td)
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{String} cronTimings
{Function} method
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 * * * ?',method)
// 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 ? * *',method,dateNow,date5Days)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddCronJob-String_String_Function_Date
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, method, startDate)
Table Row (tr)
iddes
Table Cell (td)
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{String} cronTimings
{Function} method
{Date} startDate
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 * * * ?',method)
// 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 ? * *',method,dateNow,date5Days)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddCronJob-String_String_Function_Date_Date
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, method, startDate, endDate)
Table Row (tr)
iddes
Table Cell (td)
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{String} cronTimings
{Function} method
{Date} startDate
{Date} endDate
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 * * * ?',method)
// 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 ? * *',method,dateNow,date5Days)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddCronJob-String_String_Function_Date_Date_ObjectArray
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, method, startDate, endDate, arguments)
Table Row (tr)
iddes
Table Cell (td)
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{String} cronTimings
{Function} method
{Date} startDate
{Date} endDate
{Object[]} 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 * * * ?',method)
// 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 ? * *',method,dateNow,date5Days)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function
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, method)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{Date} startDate
{Function} method
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,method,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function_Number
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, method, repeatInterval)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{Date} startDate
{Function} method
{Number} repeatInterval – ms
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,method,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function_Number_Number
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, method, repeatInterval, repeatCount)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{Date} startDate
{Function} method
{Number} repeatInterval – ms
{Number} repeatCount
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,method,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function_Number_Number_Date
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, method, repeatInterval, repeatCount, endDate)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobName
{Date} startDate
{Function} method
{Number} repeatInterval – ms
{Number} repeatCount
{Date} endDate
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,method,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function_Number_Number_Date_ObjectArray
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, method, repeatInterval, repeatCount, endDate, arguments)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{Date} startDate
{Function} method
{Number} repeatInterval – ms
{Number} repeatCount
{Date} endDate
{Object[]} 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,method,20000,40,endDate)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddJob-String_Date_Function_ObjectArray
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, method, arguments)
Table Row (tr)
iddes
Table Cell (td)
Adds a job to the scheduler.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} jobname
{Date} startDate
{Function} method
{Object[]} 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,method,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
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)
Returns the last job run from the scheduler.
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
plugins.scheduler.getLastRunJobName();
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;
Boolean
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
{String} jobname
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
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)