Skip to Content
bpms.ai

Model tree

List, create, rename, move, and delete the folders and models of the process model tree.

The process models of a tenant are organized in a tree of folders and models, the same tree BPMS 3.x shows in its process designer. Every node has an id, a name, and isFolder; every new folder or model goes inside an existing folder. The operations below work on the tree of your tenant only, and require the BPMS 3.x authorities of the designer.

OperationCallAuthority
List the treeGET /api/v1/model/nodes2.1 (Model), 2.2.2.1, or 2.2.2.2
Create a folder or a modelPOST /api/v1/model/nodes2.1.3 (Save) or 2.1.4 (Save As)
Rename a nodePATCH /api/v1/model/nodes/{id}2.1.3 or 2.1.4
Move a node to another folderPUT /api/v1/model/nodes/{id}/parent2.1
Delete a node and its contentsDELETE /api/v1/model/nodes/{id}2.1.3 or 2.1.4

List the tree

curl -sS -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/model/nodes"

The answer holds every folder and model of the tenant, the root folders first:

{
  "items": [
    {"id": 1, "name": "Processes", "isFolder": true},
    {"id": 2, "name": "Purchasing", "isFolder": false, "parent": {"id": 1, "name": "Processes", "isFolder": true}}
  ]
}

parent is absent on a root folder.

Create a folder or a model

curl -sS -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  "$BPMS_URL/api/v1/model/nodes" -d '{"parentId": 1, "name": "Purchasing", "isFolder": false}'

parentId must be a folder of your tenant. With isFolder set to false it creates an empty model. It answers 201 with the new node and its address in the Location header.

Rename a node

curl -sS -X PATCH -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  "$BPMS_URL/api/v1/model/nodes/2" -d '{"name": "Purchase orders"}'

It answers 200 with the renamed node. Nothing else changes.

Move a node

curl -sS -X PUT -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  "$BPMS_URL/api/v1/model/nodes/2/parent" -d '{"parentId": 3}'

It moves the node, with everything inside it, into another folder, and answers 200 with the node. Moving it to the folder it is already in changes nothing. A root folder cannot be moved.

Delete a node

curl -sS -X DELETE -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/model/nodes/2"

It deletes the node and everything inside it, as BPMS 3.x does, and answers 204. A deletion cannot be undone. A root folder, or a node whose contents are still in use, for example by a deployed process, is not deleted.

Rules and errors

Names are required, cannot be blank, and have at most 255 characters. Every change is recorded in the audit log in the same transaction. Creations, moves, and deletions in the same tenant's tree take turns, so two of them at the same time cannot leave the tree inconsistent.

StatuscodeWhen
400core.validation-failedA field is missing or invalid; errors names each field.
401core.authentication-requiredThe call has no valid token.
403core.authority-requiredThe caller lacks the authority the operation requires.
404model.node-not-foundThe node does not exist in your tenant or is deleted.
409model.parent-not-folderThe parent is a model, not a folder.
409model.move-into-descendantThe node would move into itself or into one of its own folders.
409model.root-not-changeableA root folder cannot be moved or deleted.
409model.node-in-useSomething still uses the node or its contents, such as a deployment.
409model.node-sharedThe node's contents include a node of another tenant.

In the OpenAPI document, the operations are listModelNodes, createModelNode, updateModelNode, moveModelNode, and deleteModelNode, under the model tag.

On this page