Skip to main content

State

Each trace has a state object which contains the business data but also metadata about the trace’s lifecycle. The state object can be accessed in the effects via dsl.$variables.state and has the following properties:
data
object
The business data of the trace.
nextActions
object
A mapping between a group label and it’s next possible actions.
tasks
object
The most relevant next actions for each group.
notifications
object
The notifications that will be sent to the user.

Data

The dsl.$variables.state.data property is an object that holds the business data for the trace, structured according to the workflow’s specifications. The data are updated by the effects of each action and is usually used to display the trace’s data in the workflow overview table and trace infos.

Next actions

The dsl.$variables.state.nextActions property defines which actions are available for each group. It is defined as a map between a group label and a list of actions keys.

Tasks

The dsl.$variables.state.tasks property, also referred to as priorities, defines which next actions are the most relevant for a group. When a group has a next priority action defined, it will be displayed in the Trace UI homepage.
{
  ...
  tasks: {
    groups: {
      cook: { // the group label
        responsibility: 1,
        todo: ['cookOrder'] // the next priority
      }
    },
    deadlines: [
      {
        date: '2025-11-20' // optional deadline
      }
    ]
  }
  ...
};
A deadline can be optionally defined for a task.

Meta

The read-only dsl.$variables.meta object contains metadata about the trace, as well as the last performed action. It is automatically generated before effects are applied and can not be modified.It’s usually used to get context about the trace in the effects or to display information using widgets.
If the query context is a widget, properties related to the last link are nested under the head property.

Formdata

The dsl.$variables.formData object is the data submitted by the user in the current action.
{
  "data": {
    "order": {
      "name": "Pineapple pizza",
      "date": "2024-04-24T09:16:56.316Z",
      "price": 10
    },
    "isPaid": true,
    "status": {
      "progress": 0.5,
      "value": "Pizza is being prepared"
    },
    "isTraceClosed": false,
    "comments": [...],
  },
  "nextActions": {
    "cook": ["prepareOrder", "comment"],
    "client": ["comment"]
  },
  "tasks": {
    "groups": {
      "cook": {
        "responsibility": 1,
        "todo": ["prepareOrder"]
      }
    }
  },
  "notifications": {...}
}