Database Tasks and Database Task Chains¶
Database Task and Database Task Chains provide the capability to execute and run server methods with configuration of parameters and validation methods. These tasks can be scheduled with Database Task Schedule and Database Task Chain Schedules, to setup reoccurring or single executions.
Read more about the concept Database Tasks
Configuration of System Parameters¶
General configuration of Database Tasks and Database Task Chain Schedules are managed from the System Parameters page. These three parameters control the schedule behaviors.
- Scheduled tasks process startup interval (seconds), defines how often the Scheduled tasks process checks if there are any scheduled Database Task or Database Task Chain to execute.
- Scheduled tasks process startup, defines if the Schedule process is started or not.
- Cleanup age limit in days for inactive Schedules, defines how many days an inactive Schedule will remain before it is removed by the Heavy Cleanup process.
The Schedules process saves a start date and start time when you save the parameter values.
Definition of a Database Task¶
|Name||Name of the task.|
|Component||Defines which component the method belongs to.|
|Method||The server method to be scheduled. In the format package.procedure. A method can only be connected to one Database Task.
Note: Only procedures in _API packages are allowed when creating new Database Tasks.
|Type of Arguments||Type of arguments that the chosen method is expected to handle.
Type of argument:
|Validation Method||Method that is used to validate the Database Task parameters. The method must take one parameter that is an IFS Message.|
|Single Schedule||If enabled, the Database Task can only be assigned to one single schedule. This can be used to avoid several executions at the same time.|
|Check Executing||If enabled, the Database Task is only started if no other instance of it is already executing or waiting in queue. Instead of posting a new task, the next executing time is calculated.|
|Check Same Day
|If enabled, the Database Task can only be executed if today's date is equal to next executing date of the Schedule assigned to the Database Task. If not, a new next executing date is calculated without running the task.|
All users with the permission to execute the method can view, create and change a scheduled task.
- Export Tasks
Used to export task definition to a file. This file can be used to import the task at another installation of IFS Cloud.
- Grant Database Task
Grant permission for the selected task.
Create New Database Task¶
To create a new Database Task, use the New Database Task page. To edit a Database Task, use the Database Task page.
When creating a new Database Task, start by selecting which method the Database Task should execute. Choose a component to have all methods filtered for that component, or chose a method not based on component. When a method has been selected, a name for the Database Task is suggested.
Parameters can be added, modified and removed to correspond to the method executed by the Database Task. Default values can be set for the parameters either as a static value, in the Value column, or as an SQL expression, in the Default Expression column. If a method is used as the Default Expression, all users that need to schedule the Database Task must be granted access to the method set in Default Expression.
Definition of a Database Task Chain¶
|Name||The name of the Database Task Chain.|
|Component||Defines which component the chain should belong to.|
|Step No||The steps in a chain executes in the Step number order.|
|Break on Error||Determines what should happen if a step executes with an error.
- Yes/Enabled means that the Database Task Chain is stopped after this step has encountered an error.
- No/Disabled means that the Database Task Chain continues with the next step after the step has been executed successfully.
|Database Task||Name of the Database Task to be executed in this step. The name represents a Database Task that exists.|
|Database Task Parameter||Shows the parameters and its default values connected to the task|
Create New/Edit Database Task Chains¶
To create a new Database Task Chain, use the New Database Task Chain page. To edit a Database Task Chain, use the Database Task Chain page.
When creating a new Database Task Chain, give it a name and connect it to a component. The chain can consist of Database Tasks from several components, so the component is only an administrative attribute on the Database Task Chain. The recommendation is to choose the component that has the most Database Tasks within the Database Task Chain.
Add the Database Tasks that should be executed within this Database Task Chain. Set in which order each step should be executed and if the Database Task Chain should break or not upon an error. It is possible to execute the same task several times with different parameters in a Database Task Chain.
Note: When adding a step to a database task chain which has already been scheduled, make sure that the relevant step in the already scheduled database task chains are also updated.
Schedule a Database Task or a Database Task Chain¶
If you want to schedule and run a Database Task or Database Task Chain, to navigate to the schedule pages from the Database Task or the Database Task Chain detail pages.
Export & Import Database Tasks and Task Chains¶
From the overview forms Database Tasks and Database Task Chains it is possible to export one or more tasks. Exporting one tasks will result in an XML-file with the task definition. Exporting several tasks at the same time will generate a Zip-file containing all the chosen tasks.
Use the Import Database Tasks and Task Chains page to import tasks. The import only accepts XML-files generated from the export in IFS Aurena. Import of a Database Task or Database Task Chain will always replace existing tasks.