Page History
Wiki Markup |
---|
{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{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#addCronJob]\(jobname, cronTimings, globalMethod, startDate, endDate, arguments) Adds a cron job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, globalMethod, repeatInterval(ms), repeatCount, endDate, arguments]]/ [arguments) Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getCurrentJobNames]\() Returns an array with the current jobs.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getLastRunJobName]\() {td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeJob]\(jobname) Removes a job from the scheduler.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addCronJob{span}{span:id=iets|style=float: left;}\(jobname, cronTimings, globalMethod, startDate, endDate, arguments){span}{td}{tr}{tr:id=des}{td}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_des|text=|trigger=button}{sub-section}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_des|trigger=none|class=sIndent}Adds a cron job to the scheduler.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_prs|trigger=none}jobname cronTimings globalMethod \[startDate\] \[endDate\] \[arguments\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_ret|text=|trigger=button}{sub-section}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_see|text=|trigger=button}{sub-section}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_see|text=|trigger=button}{sub-section}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_sam|text=|trigger=button}{sub-section}{sub-section:4338CF6C091136B9-A27EE800-4D594E04-A066B78C-112F3F4E58A180BF4D6E2E53_sam|class=sIndent|trigger=none}{code:language=javascript} // see: http://quartz.sourceforge.net/firstTutorial.html#cronTriggers 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) {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addJob{span}{span:id=iets|style=float: left;}\(jobname, startDate, globalMethod, repeatInterval(ms), repeatCount, endDate, arguments]]/ [arguments){span}{td}{tr}{tr:id=des}{td}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_des|text=|trigger=button}{sub-section}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_des|trigger=none|class=sIndent}Adds a job to the scheduler.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_prs|trigger=none}jobname startDate globalMethod \[repeatInterval(ms)\] \[repeatCount\] \[endDate\] \[arguments]]/ [arguments\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_ret|text=|trigger=button}{sub-section}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_see|text=|trigger=button}{sub-section}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_see|text=|trigger=button}{sub-section}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_sam|text=|trigger=button}{sub-section}{sub-section:E73D10AB30F99684-D92C0497-414446E6-A9309F1E-8FFE4CCBB8612CDC6EC16253_sam|class=sIndent|trigger=none}{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,globalMethod,20000,40,endDate) {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09}{tr:id=name}{td}h6.getCurrentJobNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getCurrentJobNames{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_des|text=|trigger=button}{sub-section}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_des|trigger=none|class=sIndent}Returns an array with the current jobs.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_ret|text=|trigger=button}{sub-section}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_see|text=|trigger=button}{sub-section}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_see|text=|trigger=button}{sub-section}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_sam|text=|trigger=button}{sub-section}{sub-section:F86A5EF8CB006F64-D1887931-4FD6435A-BCB09DDC-F95827A6995320645117EC09_sam|class=sIndent|trigger=none}{code:language=javascript} // Returns an array of current jobnames plugins.scheduler.getCurrentJobNames() {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156}{tr:id=name}{td}h6.getLastRunJobName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getLastRunJobName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_des|text=|trigger=button}{sub-section}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_ret|text=|trigger=button}{sub-section}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_see|text=|trigger=button}{sub-section}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_see|text=|trigger=button}{sub-section}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_sam|text=|trigger=button}{sub-section}{sub-section:52481D4770BFB83C-EDD967EF-463449B1-812BA958-947645D300EB9DD3C0CDD156_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0}{tr:id=name}{td}h6.removeJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeJob{span}{span:id=iets|style=float: left;}\(jobname){span}{td}{tr}{tr:id=des}{td}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_des|text=|trigger=button}{sub-section}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_des|trigger=none|class=sIndent}Removes a job from the scheduler.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_prs|trigger=none}jobname {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_ret|text=|trigger=button}{sub-section}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_see|text=|trigger=button}{sub-section}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_see|text=|trigger=button}{sub-section}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_sam|text=|trigger=button}{sub-section}{sub-section:FE2C72A8E7716A8F-ED63A9ED-4CBA4945-B609A54F-E4686F8DBC71FF09475814A0_sam|class=sIndent|trigger=none}{code:language=javascript} // removes a job 'myjob' from the scheduler plugins.scheduler.removeJob('myjob') {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |
Overview
Content Tools
Activity