Processorsfor information how to continuously run methods in the background, in a client that will not be closed (automatically)
Cache
index
true
refresh
100d
id
doc
showRefresh
true
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes
2100%
height: 30px;
2Supported Clients
sWordListINLINESmartClient
sWordListINLINEWebClient
sWordListINLINENGClient
servoy sSummary
12%30%58%
height: 30px;
3Methods Summary
void
Adds a cron job to the scheduler.
void
Adds a cron job to the scheduler.
void
Adds a cron job to the scheduler.
void
Adds a cron job to the scheduler.
void
Adds a job to the scheduler.
void
Adds a job to the scheduler.
void
Adds a job to the scheduler.
void
Adds a job to the scheduler.
void
Adds a job to the scheduler.
void
Adds a job to the scheduler.
Returns an array with the current jobs.
Returns the last job run from the scheduler.
Removes a job from the scheduler.
functionservoy sDetail
2100%
height:30px
2Methods Details
addCronJob
name
addCronJob(jobname, cronTimings, method)
des
sIndent
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date_Date}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate, endDate){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
\{[Date]} endDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date_Date_ObjectArray}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate, endDate, arguments){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
Adds a cron job to the scheduler. A cron job must have at least one minute between each execution (otherwise it won't execute).
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
\{[Date]} endDate
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
prs
Parameters
sIndent
jobname
;
cronTimings
;
method
;
startDate
;
endDate
;
arguments
;
clients
Supported Clients
sIndentSmartClient,WebClient,NGClient
sam
Sample
sIdent
javascript
lastDetailRow
addJob
name
addJob(jobname, startDate, method)
des
sIndent
Adds a job to the scheduler.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval, repeatCount){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number_Date}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobName, startDate, method, repeatInterval, repeatCount, endDate){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobName
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
\{[Date]} endDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number_Date_ObjectArray}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval, repeatCount, endDate, arguments){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
\{[Date]} endDate
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_ObjectArray}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, arguments){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
prs
Parameters
sIndent
jobname
;
startDate
;
method
;
repeatInterval
ms
repeatCount
;
endDate
;
arguments
;
clients
Supported Clients
sIndentSmartClient,WebClient,NGClient
sam
Sample
sIdent
javascript
lastDetailRow
addJob
name
addJob(jobname, startDate, method, arguments)
des
sIndent
Adds a job to the scheduler.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentJobNames}{tr:id=name}{td}h6.getCurrentJobNames{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]\[]{span}{span:style=font-weight: bold;}getCurrentJobNames{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// removes a job 'myjob' from the scheduler
plugins.scheduler.removeJob('myjob');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}