Skip to main content
Skip table of contents

Orchestration Task

Definition

Memority Synchronization service enables to configure and run various tasks: Import, Export, Reconciliation and Provisioning. An Orchestration Task chains the execution of some of those tasks, by defining dependencies between tasks, and conditions to trigger or skip their execution.

Use

Orchestrated tasks are executed sequentially (never in parallel): 

Tasks Execution Conditions

"Orchestrating" tasks essentially means "conditionally execute the next task".

There are two aspects regarding the execution of a task:

  • on what condition(s) is the task executed

  • when is the task executed

On What Condition(s) is the Next Task Executed

This section focuses on the possible conditions enabling the execution of the next orchestrated task.

The first task of the chain is always executed, unless there is a time restriction (see below).

The possible configurable conditions on which the next task is executed can be:

  • execute the next task even if a "fatal" error occurred during the parent task execution. A "fatal" error prevents the whole parent task execution (for example, a CSV file to import was not found). By default, if the parent task execution fails with such a fatal error, the orchestration process stops. It should be noted that if the parent task status is either "SUCCESS" or "PARTIAL", then the next task always runs, even if 99% of the processed objects failed in the parent task, because the parent's status is still "PARTIAL" (1% succeeded)

  • the global time limit is not exceeded. To not disrupt the daily tasks manually performed by human operators, it is possible to configure a "hard" time limit after which no orchestrated task can be launched. This enables to define a period dedicated to automated processings (i.e. the orchestrated tasks execution), separated from the period dedicated to manual processings (i.e. human operators). The time limit can be defined as an absolute time (such as 03:00), or as a duration (e.g. the whole orchestration process should not run for more than 4 hours after the orchestration start time). The hard limit is checked before launching a task. If the hard limit is set to 03:00, then a task can start at 02:59,  because we cannot presume of a task duration, so it is allowed to start

When is the Next Task Executed

The next task can be executed either:

  • right after its parent termination (immediate chaining)

  • after a fixed time, e.g. after 03:30, which could also mean right after the parent task termination, if the parent finishes after 03:30. This gives some margin so that other third-party operations can occur between task executions, e.g. some third-party customer job has enough time to upload on the platform the CSV file to import. 

Access Control

Access control is applied when:

  • configuring an orchestration task, i.e. when creating/updating an Orchestration Task Definition. 

  • executing/canceling an orchestration task

  • reading the report produced by an orchestration task

  • deleting an orchestration task

All these use cases are controlled using Permissions that follow the standard schemes:

Permissions

Permissions

Security Scope

Description

OrchestrationTaskDefinition:create

OrchestrationTaskDefinition:read

OrchestrationTaskDefinition:update

OrchestrationTaskDefinition:delete

GLOBAL

The CRUD permissions on the Orchestration Task definitions. These are GLOBAL permissions (not resource based), i.e. they are not applied on a per-task basis, they apply to all tasks, similar to other configuration permissions in Citadel.

Orch:run Orch:progress

GLOBAL

The execution permissions on the Orchestration Tasks; run an Orchestration Task, or see the execution report of a Task.

Those permissions are arranged in the following rights that can be granted to users:

Rights

Right

Permissions

Security Scope

Description

sys.sync-schema-crud

OrchestrationTaskDefinition:read

GLOBAL

Can read all Orchestration Task Definitions.

sys.sync-schema-crud

OrchestrationTaskDefinition:create

OrchestrationTaskDefinition:read

OrchestrationTaskDefinition:update

OrchestrationTaskDefinition:delete

GLOBAL

CRUD capability on all Orchestration Task Definitions.

sys.orch-run

Orch:run

GLOBAL

Can run all Orchestration Tasks.

sys.orch-progress

Orch:progress

GLOBAL

Can see the execution report of all Orchestration Tasks.

sys.orch-admin

Orch:run

Orch:progress

GLOBAL

Can run all Orchestration Tasks, or see the execution report of all Tasks.

Configuration

You can access the Orchestration Tasks configuration :

  • by clicking on "Synchronization" → "Orchestration Tasks"

  • by clicking on "System" → "Configurations"->”Synchronization Service” and perform an import/export.

Properties

An Orchestration Task is configured through an Orchestration Task Definition, whose properties are listed below.

Orchestration Task Definition

Here are the "general" properties of an Orchestration Task Definition :

Property Name

Type

Mandatory

Description

Values (default value in bold)

id

String

YES

The Task identifier.

-

name

String

YES

The Task name.

-

description

String

NO

The Task description.

-

active

Boolean

NO

Whether the Task is active or not. If not it cannot be launched.

true,false

orchestratedTasks

Complex

YES

The list of orchestrated tasks. They are executed sequentially. This is a complex type, whose structure is provided in the next table.

-

executionTimeLimit

ISO-8601
local time

NO

An optional "hard" time limit after which no orchestrated task can be launched.

This field defines the time limit as an absolute time (such as 03:00:00) with the ISO-8601 format.

This hard limit is checked before launching a task. If the hard limit is set to 03:00:00, then a task can start at 02:59 (since we cannot presume of a task duration, it is allowed to start).
The time zone to use with this local time is configured in the timeZone property below.

This limit can also be defined as a duration (e.g. the whole orchestration process should not run for more than 4 hours after the orchestration start time), see the property executionDurationLimit below for the duration variant.

-

timeZone

TimeZone
code

NO

The time zone used for the above executionTimeLimit  property.

UTC

executionDurationLimit

ISO-8601
duration

NO

Mutually exclusive with the above executionTimeLimit property: the duration variant of executionTimeLimit.

-

executionPlan 

Complex

NO

Only set when the Task is scheduled. This is the cron expression defining the Task execution frequency (see XML example below).

-

OrchestratedTask

The following table describes the properties of a single orchestrated task (see property orchestratedTasks in the above table):

Property Name

Type

Mandatory

Description

Values (default value in bold)

taskId

String

YES

The identifier of the configuration of the orchestrated task, e.g. an identifier of SynchronizationTaskDefinition.

-

taskType

Choice

YES

The type of the orchestrated task. Possible values are: IMPORT, RECONCILIATION , EXPORT , PROVISIONING.

-

taskStartsAfter

ISO-8601
local time

NO

If defined, the task must start after this time. This gives some margin so that other third-party operations can occur between task executions, e.g. some third-party customer job has enough time to upload on the platform a CSV file to import.

The time zone to use with this local time is configured in the timeZone property below.

If not defined, the task will start immediately, right after the completion of its parent task.

-

timeZone

TimeZone
code

NO

The time zone used for the above taskStartsAfter  property.

UTC

taskExecutionCondition

Complex

NO

If not defined, the orchestrated task will always run, even if the execution of its parent task failed. 

This is a complex type, whose structure is provided in the next table.

-

TaskExecutionCondition

The following table describes the properties of an orchestrated task execution condition (see property taskExecutionCondition in the above table):

Property Name

Type

Mandatory

Description

Values (default value in bold)

executeOnParentTaskFailure

Boolean

NO

If true , this condition matches even if the parent task execution failed due to a "fatal" error.

true,false

Example

Here is a sample XML representation of an Orchestrated Task:

Sample Export Task
XML
<?xml version="1.0" encoding="UTF-8"?>
<dmn:OrchestrationTaskDefinition 
   xmlns:ctdcore="http://www.memority.com/citadel/core/1_0" 
   xmlns:ctdidm="http://www.memority.com/citadel/idm/1_0" 
   xmlns:dmn="http://www.memority.com/domino_sync/1_0" 
   xmlns:kit="http://www.memority.com/toolkit/1_0" 
   xmlns:notify="http://www.memority.com/toolkit/addons/notify/1_0" 
   xmlns:rule="http://www.memority.com/toolkit/rule/1_0" 
   xmlns:search="http://www.memority.com/toolkit/search-expression/1_0" 
   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sample_orchestration_task">
   <name>Sample Orchestration Task</name>
   <description>Description of Sample Orchestration Task</description>
   <active>true</active>
   <executionTimeLimit>12:12</executionTimeLimit>
   <timeZone>UTC</timeZone>
   <orchestratedTasks>
      <orchestratedTask>
         <taskId>test_exportTaskId</taskId>
         <taskType>EXPORT</taskType>
         <taskStartsAfter>12:13</taskStartsAfter>
         <timeZone>UTC</timeZone>
         <taskExecutionCondition>
            <executeOnParentTaskFailure>true</executeOnParentTaskFailure>
         </taskExecutionCondition>
      </orchestratedTask>
      <orchestratedTask>
         <taskId>test_importTaskId</taskId>
         <taskType>IMPORT</taskType>
         <taskStartsAfter>12:13</taskStartsAfter>
         <timeZone>UTC</timeZone>
         <taskExecutionCondition>
            <executeOnParentTaskFailure>false</executeOnParentTaskFailure>
         </taskExecutionCondition>
      </orchestratedTask>
   </orchestratedTasks>
   <executionPlan>
      <scheduleType>ONCE</scheduleType>
      <fireTime>2020-05-18T10:12:39.527Z</fireTime>
      <interval>0</interval>
   </executionPlan>
</dmn:OrchestrationTaskDefinition>

REST API

Memority Syncronization service exposes the following orchestration REST API.

Orchestration REST API

Resource

Method

Body

Permission

Description

Response

{tenant}/api/sync/orchestration-tasks/

GET

-

OrchestrationTask:read

List all the orchestration task definitions

As usual for configuration management.

{tenant}/api/sync/orchestration-tasks/

POST

JSON

OrchestrationTask:create

Create a new orchestration task definition

As usual for configuration management.

{tenant}/api/sync/orchestration-tasks/{task-id}

GET/PUT/DELETE

-

OrchestrationTask:read/update/delete

Get or update or delete an orchestration task definition

As usual for configuration management.

All APIs below relate to instances administration

{tenant}/api/sync/orchestration-tasks/{task-id}/instances

POST

-

Orch:run

Launch an orchestration task by providing the identifier of an OrchestrationTaskDefinition task configuration (path variable).

The execution of this method is asynchronous, it immediately returns to the caller an UUID, the task instance id, that can then be used in the API methods below.

Success

HTTP code 200.

Body: a task instance id as a simple string (not JSON): an UUID identifier enabling to monitor the task progress, or cancel the running task (see below).

Errors

HTTP code 404 if the task configuration id is not found.

{tenant}/api/sync/orchestration-tasks/{task-id}/instances

GET

-

Orch:progress

Get the report of all the orchestration task executions of the given task definition

Success

HTTP code 200.

Body: a JSON list of task reports (see above)

{tenant}/api/sync/orchestration-tasks/{task-id}/instances/{task-instance-id}

GET

-

Orch:progress

Monitor the execution of an orchestration task. It returns a task report

The task-instance-id path parameter is the task tracking id that was immediately returned when the task was launched (see above).

Success

HTTP code 200.

Body: JSON Task report information of a given task instance (see below)

Errors

HTTP code 404 if the task instance id is not found.

{tenant}/api/sync/orchestration-tasks/{task-id}/instances/{task-instance-id}/~cancel

POST

-

Orch:run

Cancel an Orchestration Task.

Success

HTTP code 200

Body: empty.

Errors

HTTP code 404 if the task instance id is not found.

HTTP code 409 ("conflict") if the task cannot be canceled because it is in a terminal state.

{tenant}/api/sync/orchestration-tasks/{task-id}/instances/{task-instance-id}

DELETE

-

Orch:run

This will delete the orchestration task instance and its report.

Success

HTTP code 204 ("No content").

Errors

HTTP code 404 if the task instance id is not found.

Read Next

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.