[POST] /tasks/{id}

[POST] /tasks/{id}

/api/bpm/tasks/{id}

Description

Performs an action defined in the request body on the task specified by the id provided in the path. In the request body, the type of action is set as value for the action property.

The following actions are available for the user(s) with the corresponding responsibility:

Action

Responsibility

Effect on the Task

claim

if assignee is null: candidate users

 

Depersonalization is being performed. The first candidate user who claims the task becomes the assignee.

claim

if assignee is not null: assignee

Personalization is being performed. The assignee can return the task to all candidate users by setting the assignee property back to null.

cancel

 

The task is canceled.

resetTo

With the executionPoint, the reset point for the task will be specified. It can be:

  • create (reset to the task after its creation but before the first scripts were executed)

  • forward(before it is forwarded)

  • end(before it is ended but after the forward scripts)

If the option dryRun is set to true, the system performs a simulation and returns the tasks that would be deleted, without actually removing them.

Before a process can be reset, it must be suspended.

The task is reset or if the dryRun option is enabled, a simulation is performed.

suspend

 

The task is suspended.

activate

 

The task is activated.

If the action is claim and if the assignee is null then depersonalization is performed.
In case the action is claim and the user id is specified as the assignee, the personalization task will be performed on that user.

Required system role

For the following actions the system role R_WFADM_START (ID = 20) is necessary: cancel, resetTo, suspend, activate.
The action claim can be used without any System role.

Request
Method

POST

Response
Format

JSON

Minimum Version

1.0.0

Example
for personalization

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Response

{ "action": "claim", "assignee" : "E68A04C8054C4BEA9990995A4D629C7F" }

HTTP/200 without content

Example
for depersonalization

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Response

{ "action": "claim" }

HTTP/200 without content

Example
for cancellation

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Reponse

{ "action": "cancel" }

HTTP/200 without content

Example
for activate

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Response

{ "action": "activate" }
{ "objects": [ { "id": "33AFD89453E248B4BC7CBF594D64BE36", "state": "<State after activation>" } ], "numItems": 1, "hasMoreItems": false, "totalNumItems": 1 }

Example
for suspend

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Reponse

{ "action": "suspend" }
{ "objects": [ { "id": "33AFD89453E248B4BC7CBF594D64BE36", "state": "stopped" } ], "numItems": 1, "hasMoreItems": false, "totalNumItems": 1 }

Example
for resetTo

/api/bpm/tasks/33AFD89453E248B4BC7CBF594D64BE36

Request Payload

Response

{ "action": "resetTo", "executionPoint": "create", "options": { "dryRun": true } }
{ "objects": [{ "id": "0EE6FA8803D444518AA480F64BDFA70F", "name": "Erster Arbeitsschritt" }] }

If a resetTo action is executed the response include the deleted tasks. On a dryRun this are the potential deleted tasks as a preview for a client.

Result example
other actions

For all actions the following response status codes are present:

  • 200 - The task was found and the action successfully performed.

  • 400 - An invalid request has been passed. Status description contains additional information about the error.

  • 403 - User is not allowed to depersonalize a task.

  • 404 - The requested task was not found.

  • 500 - Server error.