Performing an object transition through a workflow: PUT

PUT method of the workflows service performs object transitions through the workflows (including sequential ones). The request is made with the path <server URL>/rest/<service name>/<class name>/<object id>.

The class name is specified with the namespace.

One of the options is passed in the request body:

  • an object with attributes - the names of workflows that contain a list of transitions for these workflows.
  • a list of strings of the following format <workflow name>.<transition name>

the names of workflows are indicated with a namespace.

Query example:

PUT
https://localhost:8888/rest/workflows/workflowBase@develop-and-test/1
body: {
      'simpleWorkflow@develop-and-test': [
        'startCheck',
        'accept'
      ]
    }

which is equivalent to:

PUT
https://localhost:8888/rest/workflows/workflowBase@develop-and-test/1
body: [
    'simpleWorkflow@develop-and-test.startCheck',
    'simpleWorkflow@develop-and-test.accept'
]

The transitions are performed sequentially. For each transition an attempt will be made, even if an error has occurred in one of them.

In response, a list of errors for each transition will be returned:

[ { code: 'workflow.ti',
    params: { workflow: 'Simple WF', trans: 'Start checking' },
    message:
     'Невозможно выполнение перехода \'Start checking\' рабочего процесса \'Simple WF\'.' },
{ code: 'workflow.ti',
    params: { workflow: 'Simple WF', trans: 'Accept' },
    message:
     'Невозможно выполнение перехода \'Accept\' рабочего процесса \'Simple WF\'.' } ]

or an empty list.

The examples of PUT``requests to ``workflows in dnt: test/modules/rest/workflows.spec.js

/checking workflows service/# move the object through workflow: PUT, list body
/checking workflows service/# move the object through workflow: PUT, object body