Skip to content

Manage Task Items


Data Type

You can manage task items by specifying task-item as <dataType> in the SEAL OP-CLI call:

opcli task-item <command> <option>

Display the Options and Parameters

By specifying the --help option, you get the available options and parameters for the task-item data type:

opcli task-item --help

Create a Task Item

With the create command, you create a task item:

opcli task-item create <taskId> --href <href> --service-id <serviceId> [--index <index>] [--metadata <metadata>]
  • <taskId>: ID of the task to which the new task item is to be added; mandatory

  • --href <href>: Reference of the document to be linked to the task item; mandatory

  • --index <index>: List position of the new task item; <index> starts at 0; default: The item is appended to the list.

  • --metadata <metadata>: Metadata in JSON syntax, for example, '{"status":"new", "origin":"system"}'

  • --service-id <serviceId>: Name of the connector to which the task has been assigned; available values: operator-p4 and other connectors possibly configured in SEAL Operator; mandatory

Example - create a task item at the end of the list referring to last.pdf

opcli task-item create b4522d9e-8503-4562-bb20-ae2d8454402e --href last.pdf --service-id operator-p4

Example - create a task item at the second position of the list referring to test.pdf with the status metadata

opcli task-item create b4522d9e-8503-4562-bb20-ae2d8454402e --index 1 --href test.pdf --metadata '{"status":"new"}'  --service-id operator-p4

Get the Metadata of a Task Item

With the get command, you get the metadata of a task item. The metadata are output as JSON object on STDOUT.

opcli task-item get <taskId> --href <href> --index <index> --service-id <serviceId> --embed input|output
  • <taskId>: ID of the task with the task item; mandatory

    Hint - uuid

    The task ID is the value of the tid setting and output when the task is created, for example, "tid":"cf5bfb0d-7861-499e-ad29-704f3ba1943c".

  • --embed <listType>: Type of list the task item belongs to; available values: input, output; mandatory

  • --index <index>: List position of the task item; <index> starts at 0; mandatory

  • --service-id <serviceId>: Name of the connector to which the task has been assigned; available values: operator-p4 and other connectors possibly configured in SEAL Operator; mandatory

Example - get the metadata of the second item of the list with the ID cf5bfb0d-7861-499e-ad29-704f3ba1943c

opcli task-item get cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1 --service-id operator-p4

Example - get the metadata and the input list of the first item of the list with the ID cf5bfb0d-7861-499e-ad29-704f3ba1943c

opcli task-item get cf5bfb0d-7861-499e-ad29-704f3ba1943c --embed input --index 0 --service-id operator-p4


Replace or Delete the Metadata of a Task Item

With the replace-meta command, you replace the metadata of a task item. The existent metadata are deleted and the specified metadata are set. For deleting the existent metadata, specify an empty JSON object as metadata.

opcli task-item replace-meta <taskId>  --index <index> --file <file>|--metadata <metadata> --service-id <serviceId>
  • <taskId>: ID of the task with the task item; mandatory

  • --file <file>: Path and name of a file containing the new metadata as JSON object

  • --index <index>: List position of the task item; <index> starts at 0; mandatory

  • --metadata <metadata>: New metadata in JSON syntax, for example, '{"status":"obsolete"}'

  • --service-id <serviceId>: Name of the connector to which the task has been assigned; available values: operator-p4 and other connectors possibly configured in SEAL Operator; mandatory

Example - replace the metadata of the second task item by the metadata specified as option

opcli task-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1 --metadata '{"status":"obsolete"}' --service-id operator-p4

Example - replace the metadata of the third task item by the metadata specified in the metadata.json file

opcli task-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 2 --file metadata.json --service-id operator-p4

Example - delete the metadata of the first task item

opcli task-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 0 --metadata '{}' --service-id operator-p4

Back to top