In standard setups we usually schedule the daily job daily that runs data transfer and calculates scheduled orders and then a monthly or weekly task to update the forecasts.
When data mapping has been completed (see specific module chapters such as Inventory RAW layer data mapping) we need to make sure the relevant stg elements are scheduled to be run periodically. Historically this was done through SQL Agent by scheduling jobs but after version 6.2 this is handled by the AGR Scheduler.
To create a new scheduled task you click the + up in the right corner. The tasks that you can choose from can be found in the [Agr5DevSlot_stg].[core].[stg_run]
table, for information on how to set it up check out the data-flow chapter. The Enabled
switch allows you to chose whether your scheduled task is enabled or disabled. When disabled, the task will not run although it is scheduled for that time. This is done to allow for temporary disabling without losing the schedule you have set for the task.
As usually, you may edit the task by clicking the pencil.
To manually start a task you click the play button next to the pencil.
Here you get a couple of options. If the last run of your selected task stopped because of an error, you can choose to resume the task from the last failed step. You also have the option to run a task partially. You can leave the starting or ending point blank, then the task will run from the first step or finish on the last step respectively.
When a task has started running, the progress of it will be shown in the Status
column. The play button will become a stop button, which will stop the task when clicked. Note that it may still take some time, as it depends on the task that is running how fast it can be stopped. You also get a red notification bubble up in the navigation bar, indicating that the task is running. Note that you will need to chose the Show notifications from all users
in the notification dropdown to get notified when the Scheduler is running a task by its schedule.
To show the history sidebar, click the history button.
The history sidebar shows you details about the runs that the selected tasks has had.
The best way to learn how the new calendar and scheduling feature works is to play around with it.
So dive in!
To show the calendar sidebar, click the calendar.
A few things to notice here:
shift dates
buttons appear when you include an interval, e.g. in this example the task is scheduled every other day. You can then shift the dates in case they didn’t start on the date you desired.save
, then you get more space for the calendar itself.Pro tip: you can double-click on any weekday or month to select/deselect all!
Yes. You read correctly. You can multi-edit the schedules of scheduled tasks! You can also delete multiple tasks if you want. You can even select a few and tell them all to set their schedule to the same one! Let’s check it out.
If you select more than one scheduled task, you get a colorful overview of all of them in the calendar.
On the right hand side, you can see the Use settings from
option. There you can make both schedules behave like the one you choose.
Table [dbo].[scheduled_tasks]
contains all scheduled tasks.
There are two columns holding the status of each run:
execution_status
; Ready = 0, Running = 1, Finished = 3, Disabled = 10
last_execution_result
; New = 0, Completed = 303, Stopped = 304, Error = 306, CompletedWithErrors = 307