Skip to main content Skip to complementary content

RunTask

Run the selected task according to the specified option.

Required User Role: See Required Enterprise Manager permissions.

Syntax

public AemRunTaskResp RunTask(

AemRunTaskReq payload,

string server,

string task,

AemRunTaskOptions option = AemRunTaskOptions.RESUME_PROCESSING,

int timeout = 30

);

Parameters

Parameters
Parameter Type Description

payload

AemRunTaskReq

-

Cdcposition

string

The cdcposition parameter can either be specified inline or in an external JSON file. The format for both is described in Request body format below.

Mandatory for all AemRunTask options.

server

string

The name of the server on which to run the task.

task

string

  • Replicate: - The name of the task.
  • Compose: - The name of the task or workflow appended with a double underscore and the project name.

    Example:  

    mytask__myproject

option

AemRunTaskOptions

{

NONE = 0,
RESUME_PROCESSING = 1,

RELOAD_TARGET = 2,

RESUME_PROCESSING_FROM_TIMESTAMP = 3,

METADATA_ONLY_RECREATE_ALL_TABLES = 4,

METADATA_ONLY_CREATE_MISSING_TABLES = 5,

RECOVER_USING_LOCALLY_STORED_CHECKPOINT = 6,

RECOVER_USING_CHECKPOINT_STORED_ON_TARGET = 7

}

For replication tasks, any of the options (except NONE) can be specified. For Compose tasks, only NONE can be specified.

timeout

int

The time in seconds to wait for a response.

Request body format

If the task option (see above) is RESUME_PROCESSING_FROM_TIMESTAMP, then use the following format:

{"cdcposition":"timestamp"}

Example:  

{"cdcposition":"2017-03-07T11:19:03"}

"{\"cdcposition\":\"timestamp\"}"

Example:  

"{\"cdcposition\":\"2017-03-07T11:19:03\"}"

 

If the task option (see above) is RECOVER_USING_CHECKPOINT_STORED_ON_TARGET, then use the following format:

{"cdcposition":"target_checkpoint"}

Example:  

{"cdcposition":"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0"}

"{\"cdcposition\":\"target_checkpoint\"}"

Example:  

"{\"cdcposition\":\"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0\"}"

Return value

AemRunTaskResp

Return value parameters
Parameter Type Description
ErrorMessage

string

The description of the error.

State

AemTaskState

{

STOPPED = 0, RUNNING = 1,

ERROR = 2,

RECOVERY = 3

}

The current state of the task.

Errors

Error responses
Error Message Description

AEM_TASK_ALREADY_RUNNING

Replicate task {task} on server {server} is already running.

The task cannot be run because it is already running.

AEM_TASK_IN_RECOVERY

Replicate task {task} on server {server} cannot be run as it is in a recovery state.

The task cannot be run because it is in Recovery state.

AEM_WRONG_OPTION_FOR_CDCPOSITION

Replicate task {task] on server {server} cannot be run with cdcposition {position} and option {option}. Change the option to RESUME_PROCESSING_FROM_TIMESTAMP or RECOVER_USING_CHECKPOINT_STORED_ON_TARGET.

When the option Tables are already loaded. Start processing changes from Timestamp is selected in the Advanced Run Options dialog box for a task, the option sent to the API must be RESUME_PROCESSING_FROM_TIMESTAMP.

AEM_CDC_POSITION_ERR_FORMAT

The cdcposition parameter value for Replicate task {task} on server {server} is not in the correct format ('YYYY-MM-DDThh:mm:ssZ').

The cdcPosition parameter must follow this format: YYYY-MM-DDThh:mm:ssZ

Parameters: task name and server name

AEM_RUN_TASK_TIMEOUT

Replicate task {task} on server {server} timed out when requested to “Run”.

The task does not assume a Running state or any other steady state (error o stopped).

AEM_RUN_TASK_INNER_ERR

Replicate task {task} on server {server} encountered an error when requested to run.

Replicate experienced an error/exception when trying to run the task.

AEM_RUN_TASK_NO_SRC_NO_TRG

Replicate task {task} on server {server} has no source or target endpoints.

Task validation revealed that the task is missing a source and a target.

AEM_RUN_TASK_NO_SRC

Replicate task {task} on server {server} has no source endpoint.

Task validation revealed that the task is missing a source.

AEM_RUN_TASK_TRG

Replicate task {task} on server {server} has no target endpoint.

Task validation revealed that the task is missing a target

AEM_RUN_TASK_NOT_FL_NOR_CDC

Replicate task {task} on server {server} cannot be run without at least one of the replication options enabled (Full Load, Apply Changes, or Store Changes).

Task validation of a unidirectional task revealed that the replication option definition for the task is missing (Full Load, Apply Changes, or Store Changes).

AEM_RUN_BIDI_TASK_NO_FL_NOR_CDC

Replicate task {task} on server {server} cannot be run without at least one of the replication options enabled (Full Load or Apply Changes).

Task validation of a unidirectional task revealed that the replication option definition for the task is missing (Full Load, Apply Changes, or Store Changes).

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!