Curriculum: schedule or execute ad-hoc tasks
- In this lesson:
- 1Schedule or execute tasks (scripts)
- 2View the results of (scheduled) scripts
- 3Detailed results of (scheduled) scripts
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
Schedule or execute tasks (scripts)
Via the menu-option Script the administrator can run and/or schedule tasks to perform operations in the system.
The Script menu item provides the option to view the scheduled task and run or schedule new tasks.
The example shows an overview of the scripts, with in this case two scheduled jobs that are executed on weekdays:
- Generate wizards for workflow will run from Monday till Friday at 05:00, for the year 2020
- Generate schedules will run from Monday till Friday at 04:30, for the year 2020
At the bottom the administrator has selected the Generates wizard for workflows script to execute it as an ad-hoc (immediate) script.
To add a new one:
- select the script
- define the argument(s)
- define the cron parameters (interval and timing).
- Click on Schedule
To modify a script, add a new one and delete the existing script.
To (ad-hoc) execute a script:
- select the script
- define the argument(s)
- Click on Execute
Scripts can be scheduled using a CRON timing notation.
View the results of (scheduled) scripts
Supported scripts in the system are:
- Calculate costs - used to re-calculate costs on a regular basis.
- Calculate staffing - used to re-calculate workforce load on a regular basis.
- Cleanup database - remove all data from the database
- Clear audit logs - remove all audit information from the system
- Clear deleted years - remove all academic years (and their data) marked as 'delete'. The deletion will be affected 30 days after the academic year is marked as 'delete'. This to allow the administrator to have 30 days to rethink and adjust the delete option if necessary.
- Clear logs - clear the different logs (notification, request)
- Clear the cache - used to refresh the in-memory cache on the server.
- Generate module CSV - export all (approved) modules for an academic year in CSV format.
The exported file is available in the administrator configured location and can be retrieved via the administrator menu Report files. - Generate module group CSV - export all (approved) module groups for an academic year in CSV format.
The exported file is available in the administrator configured location and can be retrieved via the administrator menu Report files. - Generate reference CSV - export all references in a standard CSV format that matches the 'import CSV format'. This allows transferring reference values via CSV from one system to another.
- Generate study CSV - export all (approved) studies for an academic year in CSV format.
The exported file is available in the administrator configured location and can be retrieved via the administrator menu Report files. - Generate wizard for workflows - (re-)generate the tasks for the defined processes and workflows
- Refresh application context - refresh the generic application settings that are configured via a release, without system downtime
- Refresh view (study usage) - (re)generate the view for study usage on a regular basis
- Refresh views - (re)generate all views in the system
- Run export data - used to schedule the interface in case a more batch-oriented messaging is required.
- Run import data - used to schedule the interface in case a more batch-oriented messaging is required.
- Run import reference - used to schedule the interface for reference data in case a more batch-oriented messaging is required.
- Send invite participants - used to send a notification to ALL users that have an open task
- Send test mail - sent a test mail to check if the mail configuration is correct.
- Sends mails for a day - (re)send the mails for a specific day.
- Start processes on start date - start the processes that are configured to be auto-started on the specified start date.
- Synchronize labels - helper function mainly for system support, that allows to get all new labels and translations from the central label repository.
The arguments for the script depend on the selected script, and will be shown after selection of the script.
Offered arguments over the different scripts are:
- Year - The academic year (version) for which the script must be executed. Is required depending on the selected script.
- EntityType - The object type (study, module, module group, ...) for which the script must be executed. Is only applicable (and required) for the 're-apply history' script.
- Directory - The directory to save the generated files. Is only applicable (and required) for the script generating export CSV's
- Message - The message to report in te logging when executing the script. Is only applicable for the 'run export data' script.
- System - The system the data has to be sent to when executing the script. Is only applicable (and required) for the 'run export data' script.
- ReferenceDate - The reference Date the script must be executed. Is only applicable (and required) for the 'mail for a day' script.
- Iterations - The amount of iterations to be used in calculation the costs. This is implementation dependant.
- Retention period - The period the logs should be kept. Older logs will be deleted.
- Notification - the notification to be sent to all users with an open task
Detailed results of (scheduled) scripts
The menu-option Script can be used by the administrator to automatically schedule or manually execute tasks in the system.
These tasks are run in background, the results are available via the menu option Batch jobs. An overview is provided of al scripts executed including the status and messages of each processed object.
The information available in the report is:
- Type - Script type and unique ID of the executed script.
- Status - Status indicating if the script has run successfully or has failed.
- Start date - Timestamp the script is started
- End date - Timestamp the script is finished
- Current step - The step the batch job is processing
- Messages - Number of messages that are processed
- Grey: Items processed
- Red: Unsuccessfully processed, no change to system performed due to authorization, status or other rules from preventing change - Quantity - Number of objects touched by the job.
Click on the job to open the detail scherm on status and messages.
The first tab shows the parameters used to execute the script.
The second tab provides insight in the messages generated while executing the script.
In case of an Error the task for the object is not processed, in case of a warning or info the task is executed for the object.