Property description
The workflows property is a set of workflow states that an object goes through during its lifecycle in Dawiso.
Before creating a workflow, make sure you already defined your workflow states.
Minimal JSON
{
"key": "",
"name": "",
"initStateKey": ""
}{
"key": "basic_workflow",
"name": "Basic workflow",
"description": "",
"state": "active",
"isDefault": false,
"isEmpty": false,
"initStateKey": "draft",
"diagramContentType": "image/png",
"diagramContent": "iVBORw0KGgoAAAANSUhEUgAACGAAAARmCAIAAAD...",
"transitions": [
{
"name": "Draft",
"fromStateKey": "approved",
"toStateKey": "draft",
"changeThresholdTypeKey": "one_user",
"userRelationTypes": [
{
"key": "core#steward"
}
]
}
]
}Example taken from the core package.
Ownership
A workflow can be defined in one package only. When a package defines a workflow that another package already owns, the install fails with an error naming the owning package (“Workflow '
Nested properties
| Property | Description | Values | Mandatory |
|---|---|---|---|
key | Unique key of the asset. Used for referencing in the same package or other packages using packageKey#assetKey. | string | Yes |
name | Name of the asset, used as the default EN translation. | string | Yes |
initStateKey | Key of the workflow’s initial workflow state. | string | Yes |
description | Description of the property, displayed as a tooltip. | string | No |
diagramContentType | Workflow diagram image type, in MIME format. Supported values: image/png, image/jpeg, image/svg+xml. | string | No |
diagramContent | Workflow diagram in Base64 format. | string | No |
isDefault | Determines whether the workflow is always selected by default. | boolean | No |
isEmpty | Determines whether the workflow doesn’t have any workflow states. | boolean | No |
isSelectable | Determines whether the workflow can be selected by other users. | boolean | No |
transitions | Array of transitions between workflow states. | array | No |
layout | Positions of the workflow’s states and transitions in the workflow diagram. See Layout. | object | No |
state | Current status of the asset. Supported options are: active (asset is active and visible in the environment), inactive (asset is inactive and hidden, serves as a soft delete), hidden (asset is active but hidden in the environment). | string | No |
translations | Array of translation keys and their definitions that determine how the text is displayed in the UI for the specific asset. For more information, see Translations. | array | No |
Layout
The optional layout property stores where each state and transition is drawn in the workflow diagram. The in-app workflow editor writes it when an administrator saves a workflow; you can also set it in a package. Without a layout, the diagram is arranged automatically.
{
"layout": {
"nodes": [
{ "stateKey": "draft", "x": 0, "y": 0 },
{ "stateKey": "approved", "x": 220, "y": 0 }
],
"start": { "x": -120, "y": 0 },
"edges": [
{
"fromStateKey": "draft",
"toStateKey": "approved",
"vertices": [{ "x": 110, "y": -60 }]
}
]
}
}
| Property | Description | Values | Mandatory |
|---|---|---|---|
nodes | Position of each state. | array | Yes |
nodes[].stateKey | Key of the workflow state. | string | Yes |
nodes[].x, nodes[].y | Position of the state in the diagram. | number | Yes |
start | Position of the start marker. Contains x and y. | object | No |
edges | Drawing of each transition, identified by its source and target state. | array | No |
edges[].fromStateKey, edges[].toStateKey | Keys of the states the transition connects. | string | Yes |
edges[].labelX, edges[].labelY | Offset of the transition label. | number | No |
edges[].vertices | Bends of the transition line, as an array of { "x", "y" } points in absolute diagram coordinates. Omitted when the transition has no bends. | array | No |
Every state key in layout must be the workflow’s initStateKey or a state used by one of its transitions. Otherwise validation fails with “references state [
When you patch a package, vertices is replaced as a whole collection, not merged point by point.