Task configuration
Let’s have a look at the database structure on the table “task_definition” to see a few core concepts of tasks in the CoreOne Suite.
id | Unique identifier of a task (GUID) |
---|---|
parent_id | A task could have a parent task. Once the parent task has finished executing, it will trigger any child tasks. |
type | What kind of task it is. The value saved here is the full path of the class in which the task is implemented, followed by the assembly name in which this class is saved. |
firstrun | The very first run date this task was executed for the first time. Usually this refers to the date when the task was added. |
interval_seconds | The interval in seconds when tasks are executed. Note: This does not mean the time it should wait between each task run. The interval counter starts as soon as the task is getting executed. If the task is taking longer than the configured interval, it will start immediately again. Example: Interval is set to 10 minutes. The task takes 5 minutes to complete. The next run will start in 5 Minutes. |
state | The state in which the task is currently in. The most common ones are: Note: When you change a task from state 3 (running) to another state, the underlying execution of the task will not be stopped. See further information below. |
lastrun | The last completion time of the task, which means it got to state 4 (completed) or 5 (faulted/error) after running. |
lastrun_processor | The machine name on which the task got executed last. This information is needed for running tasks on multiple machines/backends. Delete this field if you want to run the task on your current machine and you imported the task definitions from somewhere else. |
lastrun_duration_in_seconds | How long it did take for the task to complete the last time it reached state 4 or 5. |
lastrun_message | This field gets filled once the task has completed. Normally this is just “Finished” but this could also be with more information on what the task did. This field is also used if there were any errors during the execution. |
restart_action_on_aborted | What kind of action should take place when the task was aborted (e.g. through a new start of the service)? 1: do nothing 2: restart the task automatically 3: delayed by 10 minutes |
restart_action_on_error | What kind of action should take place when the task encountered errors during execution? 1: do nothing 2: restart the task automatically 3: delayed by 10 minutes |
readonly | Defines if the task is editable in the GUI. 1 = readonly 0 = editable in the GUI |
visible | Decides if the task should be visible in the task list on the GUI. 1 = visible 0 = hidden |
creation_date | Defines when the task definition entry was created. Useful mostly for scheduled or fast tracked tasks |
tenant_id | ID of the tenant to which the task belongs to |
user_id | The core identity id under which the task is executed under |
active | This active flag defines if the task will run. 1 = active 0 = inactive |
finished_state | Here it is defined in which state the task is considered finished. Usually this is state 4 (Completed) |
reference_id | A string which identifies this task instance. Is mainly used in workflows for scheduled tasks, so it can get referenced again, for example for deleting the task |
cleanup_enabled | If this is set to 1, then the task gets deleted if it reaches the finished_state id. Fast track tasks are usually cleanup_enabled, so they get deleted if task completes. |
continuation_run_time | Defines a time when a suspended task should run the next time |
serialized_state_object_value | A serialized value of the object for further information |
name | A string value for setting the name of the task. Useful for identitfying different task, for example for import tasks |
description | A string value for setting a description of the task for a more detailed specification |
Fast track tasks
A task can be fast tracked to run for a specific amount of work items so it doesn’t have to run through the whole data set.
For example: A core identity gets updated in the GUI. This executes the core identity update task and the identity update task for the specific core identity and its identities.
Task overview
A quick overview over the most used tasks in the CoreOne Suite.