Dependencies

Dependencies control when a task or step is eligible to appear. A dependency is evaluated against the data dictionary values selected for a copilot, so a task or step can be shown only when the equipment configuration matches.

For example: show a calibration step only when the user has selected the standard model, or a troubleshooting task only when an alarm is active.

Structure

The dependencies field is an array of two elements: a group operator followed by an array of conditions.

["AND", [ <condition>, <condition>, ... ]]
  • The first element is the group operator: "AND" (all conditions must match) or "OR" (any condition matches).
  • The second element is an array of conditions. Each entry is either a single condition object or a nested group (another [operator, [...]] array).

An empty array ([]) means no dependency; the task or step always appears.

Shorthand: a single condition as a string

For a single condition you can send the dependency field (singular) as a string instead of building the dependencies array:

components.{product_id}.{variable} = {value}

For example:

{ "dependency": "components.45.model = standard" }

The server expands this to the equivalent single-condition array. The operator can be =, !=, >, or <, and multiple target values can be comma-separated (components.45.procedure = 4, 5).

Use the string form for one simple condition. For multiple conditions or AND/OR nesting, send the dependencies array described below.

Condition object

Each condition compares a data dictionary variable against one or more target values.

FieldTypeDescription
variablestringThe data dictionary key to evaluate (e.g. model, procedure). Get available keys from GET /datadictionary.
operatorstringComparison operator. One of =, !=, >, <.
targetsarrayValue(s) to compare against. The condition matches if the variable's value satisfies the operator against any target. Values may be strings or numbers.
patharrayComponent path: the product ID(s) that own the variable. For a top-level product this is a single ID, e.g. [45].

Examples

Single condition — show only when model equals standard:

["AND", [
  { "variable": "model", "operator": "=", "targets": ["standard"], "path": [45] }
]]

Multiple conditions (AND) — show only when model is standard and an alarm is active:

["AND", [
  { "variable": "model", "operator": "=", "targets": ["standard"], "path": [45] },
  { "variable": "alarm_active", "operator": "=", "targets": ["yes"], "path": [45] }
]]

Multiple conditions (OR) — show when the procedure is either 4 or 5:

["OR", [
  { "variable": "procedure", "operator": "=", "targets": [4], "path": [456] },
  { "variable": "procedure", "operator": "=", "targets": [5], "path": [456] }
]]

Since targets accepts multiple values, the above can also be written as a single condition:

["OR", [
  { "variable": "procedure", "operator": "=", "targets": [4, 5], "path": [456] }
]]

Nested groups — show when model is standard and (alarm_active is yes or procedure is 4):

["AND", [
  { "variable": "model", "operator": "=", "targets": ["standard"], "path": [45] },
  ["OR", [
    { "variable": "alarm_active", "operator": "=", "targets": ["yes"], "path": [45] },
    { "variable": "procedure", "operator": "=", "targets": [4], "path": [45] }
  ]]
]]

Notes

  • variable and path must reference a data dictionary entry that exists on the copilot. Use GET /datadictionary?filter[product_id][eq]={id} to list available keys and their configured values.
  • Numeric target values are compared as numbers; string values are compared as strings.
  • Conditions with no targets are dropped. An invalid operator or a missing targets on a populated condition returns a validation error.
  • Responses may include a server-assigned id on each condition; you do not need to send it when writing.