Task Processing Integration Point

Operations

This specific API supports the following POST operations:

  • To start a single task:

http://[hostName]:[portNumber]/[api-context-root]/taskprocessing/{taskId}/restart
  • To start multiple tasks:

http://[hostName]:[portNumber]/[api-context-root]/taskprocessing/tasks/restart

Restart Multiple Tasks

This integration point allows the restart of multiple tasks at once. The request accepts a list of task IDs, and the processing will be asynchronous, which means the system will process the tasks in the background and return a resource URL to track the status. The request body can contain up to 200 task IDs to be restarted. If no task IDs are provided, the system will return the error message TSK-IP-003.

Restart All Request Message (click to open)
{
    "taskIds": ["taskId1", "taskId2", "taskId3", ..., "taskId200"]
}

How the System Handles this Request

Asynchronous Processing

The restart process runs asynchronously. The system will respond immediately with a 201 status code and a reference URL to track the operation’s progress but not the result. The ID in the reference URL represents the long-running process ID.

Initial Response (Success)

Upon receiving the request, the system will return a In Progress status and include a self-link to monitor the operation’s progress.

Example of a Success Response (Initial Request) (click to open)
{
    "processing": true,
    "status": "In Progress",
    "links": [
        {
            "rel": "self",
            "href": "http://[hostName]:[portNumber]/[api-context-root]/taskprocessing/taskrestartbatches/{id}/status"
        }
    ]
}

Tracking the Status

Query the provided self-link to track the status of the restart operation. The status will indicate whether the tasks are still being processed, completed with no errors, or completed with errors. If there are errors, detailed error messages will be provided.

Final Response (Completion)

Once processing is complete, the final status will be either:

  • Completed without errors – The restart operation was completed successfully for all tasks.

  • Completed with errors – Some tasks encountered issues during processing.

Success with No Errors (click to open)
{
    "processing": false,
    "status": "Completed without errors",
    "links": [
        {
            "rel": "self",
            "href": "http://[hostName]:[portNumber]/[api-context-root]/taskprocessing/taskrestartbatches/{id}/status"
        }
    ]
}

If any tasks fail during the restart operation, the response includes detailed error information for the affected tasks. In this case, the status is completed with errors, and detailed error messages for each failed task are included in the messagesList.

Success with Errors (Some Tasks Failed) (click to open)
{
  "processing": false,
  "status": "Completed with errors",
  "tasks": [
    {
      "id": "<id>",
      "extraInfo": "<extraInfo>",
      "status": "<status>"
      // ... other task-related fields
    }
    // ... other tasks
  ],
  "links": [
    {
      "rel": "self",
      "href": "http://[hostName]:[portNumber]/[api-context-root]/taskprocessing/taskrestartbatches/{id}/status"
    }
  ]
}

Response Status Codes

Table 1. Response Status Codes
Status Code Message

201 Created

The request was accepted and is being processed.

422 Unprocessable Entity

The request body is invalid (for example, more than 200 task IDs or invalid task IDs).

500 Internal Server Error

An unexpected error occurred while processing the request.

Error Messages

Table 2. Error Messages
Code Severity Message

OHI-IP-TASK-004

Fatal

The task ID(s) {id(s)} is/are unknown or in a non-errored status. Please verify.

OHI-IP-TASK-005

Fatal

Only up to 200 task IDs are supported. Please provide fewer than 200.

OHI-IP-TASK-006

Fatal

No task ID(s) provided. Please specify one or more valid task ID(s) to proceed.