Number | Description | Values |
1st * | Second | 0 through 59 |
2nd * | Minute | 0 through 59 |
3rd * | Hour | 0 through 23 |
4th * | Day_of_Month | 1 through 31 |
5th * | Month | 1 through 12 |
6th * | Day_of_week | 0 through 6 (i.e. from Sunday to Saturday) |
7th * | Year (Optional Field) | |
The user must specify a value for each field. Except for the year field, these fields can contain the following:
- A number in the specified range. To run a command in May, specify 5 in the month field.
- Two numbers separated by a dash to indicate an inclusive range. To run a cron job on Tuesday through Friday, place 2-5 in the weekday field.
- A list of numbers separated by commas. To run a command on the first and last day of January, you would specify 1,31 in the day_of_month field.
- A combination of two numbers separated by a dash to indicate an inclusive range and a list of numbers separated by commas can be used in conjunction. To run a command on the first, tenth to sixteenth and last day of January, you would specify 1,10-16,31 in the day_of_month field. The above two points can also be used in combination.
- An * (asterisk), meaning all allowed values. To run a job every hour, specify an asterisk in the hour field.
0 0 1,15 * 1 ?
would run command on the first and fifteenth days of each month, as well as every Monday. To specify days by only one field, the other field should contain an * .
See: http://www.opensymphony.com/quartz/wikidocs/CronTriggers Tutorial.htmlCertain tasks are already in the Job files, and the Job Files are available here for download.
To upload the job files into your Wavelet EMP system, the user will need to perform the below procedures:
1) Download the job/ task files here
2) Goto SYSTEM ADMIN > FILE MANAGER
3) Select the target folder as "/files" and add the downloaded file/s individually (if more than 1 job/ task) is required to be uploaded.
4) Describe each job/ file accordingly under "File Description" and select Document Type to be "task_scheduler_job" for each job/ task that needs to be uploaded.
5) Click "Upload File"
Creating a task (With examples)
To create a task for your Wavelet EMP system, the user will need to perform the below procedures:
1) Goto PLUGIN > (TASK SCHEDULER) CREATE TASK
2) Specify accordingly, with reference to the task, the "Group", "Name" and "Description" of the task
Example:
Group : Billing
Name : Outstanding Invoice
Description : Email notification when there is any outstanding invoice
3) Select the required job to be executed from the drop-down list under "Job". **Note that only uploaded job/ task will be shown
Example:
Select : plugin-wavelet-tasksched-invOutstandingDue
4) Key in the path for the selected job/ task in the "Main Job Class"
4.1) To identify the path for the selected job/ task, extract the initially saved file/s using programs such as winrar. 2 files should be extracted out, namely "META-INF" and "Taskscheduler"
4.2) Copy and paste the entire path from "Taskscheduler" into the "Main Job Class".
For example, if the user have downloaded the job/ task of plugin-wavelet-tasksched-invOutstandingDue.jar,
The user should be able to drill down from Taskscheduler > Notification > Invoice_due > src > InvOutstandingDueNotification.class
The path should appear as taskscheduler\notification\invoice_due\src\InvOutstandingDueNotification.class
4.3) After performing the copy and paste, replace the "\" with "." and remove the ".class"
From the above example, the path that should appear in this job/ task under the "Main Job Class" should be as below:
taskscheduler.notification.invoice_due.src.InvOutstandingDueNotification
5) Specify accordingly, with reference to the task, the "Group" and "Name" under "Trigger"
Example:
Trigger Group : Email notification
Trigger Name : Invoice triggered
Cron Script Trigger : Refer to the Table 1.1
Example for Cron Script Trigger:
CronTrigger Example 1 - an expression to create a trigger that simply fires every 5 minutes
"0 0/5 * * * ?"
CronTrigger Example 2 - an expression to create a trigger that fires
every 5 minutes, at 10 seconds after the minute (i.e. 10:00:10 am,
10:05:10 am, etc.).
"10 0/5 * * * ?"
CronTrigger Example 3 - an expression to create a trigger that fires at
10:30, 11:30, 12:30, and 13:30, on every Wednesday and Friday.
"0 30 10-13 ? * WED,FRI"
CronTrigger Example 4 - an expression to create a trigger that fires
every half hour between the hours of 8 am and 10 am on the 5th and 20th
of every month. Note that the trigger will NOT fire at 10:00 am, just
at 8:00, 8:30, 9:00 and 9:30
6) Click "Create task" to confirm the settings and create the task
7) Load the created task into the scheduler by clicking "(Re)Load Task to scheduler now"
List Task
To view created tasks, the user may goto:
PLUGIN > LIST TASK
Edit Task
From the tasks listing in PLUGIN > LIST TASK, the user may edit the created task by:
either
Clicking on the shortcut key "Edit" on the far right of each created task
or
Goto PLUGIN > EDIT TASK > KEY IN THE TASK'S PKID (which can be found in LIST TASK)
**Note to always SAVE the editted task AND CLICK RELOAD TASK TO SCHEDULER NOW