UNPKG

@camunda/zeebe-element-templates-json-schema

Version:
1,567 lines (1,566 loc) 203 kB
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "http://camunda.org/schema/zeebe-element-templates/1.0", "title": "Element Template Schema", "definitions": { "properties": { "allOf": [ { "type": "array", "description": "List of the template's properties.", "allOf": [ { "examples": [ [ { "label": "Name", "type": "String", "binding": { "type": "property", "name": "name" } } ] ] } ], "items": { "type": "object", "default": {}, "allOf": [ { "if": { "properties": { "type": { "const": "Dropdown" } }, "required": [ "type" ] }, "then": { "required": [ "choices" ] } }, { "if": { "properties": { "type": { "not": { "const": "Number" } } }, "required": [ "type" ] }, "then": { "properties": { "value": { "type": [ "string", "boolean" ] } } } }, { "if": { "oneOf": [ { "properties": { "type": { "enum": [ "String", "Text" ] } }, "required": [ "type" ] }, { "not": { "required": [ "type" ] } } ] }, "then": { "properties": { "placeholder": { "type": "string", "description": "Placeholder text shown in the property input field when it is empty. Can be used to show example input." } } }, "else": { "not": { "required": [ "placeholder" ] } } } ], "properties": { "value": { "$id": "#/properties/property/value", "type": [ "string", "number", "boolean" ], "description": "Default value to be used if the user does not provide a value or if the type is Hidden." }, "description": { "$id": "#/properties/property/description", "type": "string", "description": "Hint text shown below the property input field." }, "label": { "$id": "#/properties/property/label", "type": "string", "description": "Label text shown above the property input field." }, "type": { "$id": "#/properties/property/type", "type": "string", "description": "The type of a control field." }, "editable": { "$id": "#/properties/property/editable", "type": "boolean", "description": "Defines whether users can edit the property in the properties panel. By default, all non-hidden properties are editable." }, "choices": { "$id": "#/properties/property/choices", "type": "array", "description": "List of choices for a dropdown field.", "default": [], "items": { "$id": "#/properties/property/choices/item", "type": "object", "default": {}, "properties": { "name": { "$id": "#/properties/property/choices/item/name", "type": "string", "description": "Display name for a choice in a dropdown field. Shown to the user." }, "value": { "$id": "#/properties/property/choices/item/value", "type": "string", "description": "Value for a choice in a dropdown field. Stored in the XML." } }, "required": [ "value", "name" ] } }, "constraints": { "$id": "#/properties/property/constraints", "type": "object", "description": "Object that contains rules to validate user input to the template.", "allOf": [ { "examples": [ { "notEmpty": true } ] } ], "properties": { "notEmpty": { "$id": "#/properties/property/constraints/notEmpty", "type": "boolean", "description": "The control field must not be empty." }, "minLength": { "$id": "#/properties/property/constraints/minLength", "type": "number", "description": "The minimal length of a control field value." }, "maxLength": { "$id": "#/properties/property/constraints/maxLength", "type": "number", "description": "The maximal length for a control field value." }, "pattern": { "$id": "#/properties/property/constraints/pattern", "description": "String or object that defines a regular expression that the user's input must match.", "oneOf": [ { "type": "object", "default": {}, "properties": { "value": { "$id": "#/properties/property/constraints/pattern/value", "type": "string", "description": "The value of the regular expression." }, "message": { "$id": "#/properties/property/constraints/pattern/message", "type": "string", "description": "Custom error message to show when the user's input does not match the regular expression." } } }, { "type": "string" } ] } } }, "group": { "$id": "#/properties/property/group", "type": "string", "description": "Group in the properties panel that the property belongs to." } } } }, { "$schema": "http://json-schema.org/draft-07/schema", "type": "array", "description": "List of properties of the element template.", "items": { "type": "object", "default": {}, "required": [ "binding" ], "allOf": [ { "if": { "properties": { "binding": { "properties": { "type": { "const": "property" } }, "required": [ "type" ] } }, "required": [ "binding" ] }, "then": { "properties": { "type": { "enum": [ "String", "Text", "Hidden", "Dropdown", "Boolean", "Number" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "enum": [ "zeebe:input", "zeebe:output", "zeebe:property", "zeebe:taskHeader", "zeebe:taskDefinition:type", "bpmn:Message#property", "bpmn:Message#zeebe:subscription#property", "zeebe:taskDefinition", "zeebe:calledElement", "zeebe:linkedResource", "zeebe:formDefinition", "zeebe:calledDecision", "zeebe:script", "zeebe:assignmentDefinition", "zeebe:priorityDefinition", "zeebe:jobPriorityDefinition", "zeebe:adHoc", "zeebe:taskSchedule" ] } }, "required": [ "type" ] }, "type": { "not": { "const": "Configuration" } } }, "required": [ "binding" ] }, "then": { "properties": { "type": { "enum": [ "String", "Text", "Hidden", "Dropdown", "Boolean", "Number" ] } } } }, { "if": { "properties": { "optional": { "const": true } }, "required": [ "optional" ] }, "then": { "properties": { "binding": { "properties": { "type": { "enum": [ "zeebe:input", "zeebe:output", "zeebe:property", "zeebe:taskHeader" ] } }, "required": [ "type" ] } } } }, { "if": { "properties": { "optional": { "const": true } }, "required": [ "optional" ] }, "then": { "properties": { "constraints": { "properties": { "notEmpty": { "const": false } }, "required": [ "notEmpty" ] } } } }, { "if": { "properties": { "feel": { "not": { "const": null } } }, "required": [ "feel" ] }, "then": { "properties": { "type": { "enum": [ "String", "Text", "Number", "Boolean" ] } }, "required": [ "type" ] } }, { "if": { "properties": { "language": { "not": { "const": null } } }, "required": [ "language" ] }, "then": { "properties": { "type": { "enum": [ "Text" ] } } } }, { "if": { "required": [ "value" ] }, "then": { "not": { "required": [ "generatedValue" ] } } }, { "if": { "properties": { "type": { "enum": [ "Boolean", "Dropdown" ] } }, "required": [ "type" ] }, "then": { "not": { "required": [ "generatedValue" ] } } }, { "if": { "properties": { "type": { "enum": [ "String", "Text" ] } }, "required": [ "feel" ] }, "then": { "properties": { "feel": { "enum": [ "optional", "required" ] } } } }, { "if": { "properties": { "feel": { "const": "required" } }, "required": [ "feel" ] }, "then": { "properties": { "value": { "oneOf": [ { "type": "string", "pattern": "^=" }, { "type": "string", "not": { "pattern": "^=" }, "deprecated": true } ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:linkedResource" } }, "required": [ "type" ] } }, "required": [ "binding" ] }, "then": { "properties": { "binding": { "properties": { "linkName": { "type": "string" }, "property": { "enum": [ "resourceId", "resourceType", "bindingType", "versionTag" ] } }, "required": [ "linkName", "property" ] } } } }, { "allOf": [ { "if": { "properties": { "binding": { "properties": { "type": { "enum": [ "zeebe:input", "zeebe:output" ] } }, "required": [ "type" ] }, "type": { "enum": [ "Boolean", "Number" ] } }, "required": [ "binding", "type" ] }, "then": { "properties": { "feel": { "default": "static" } } } } ] }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:userTask" } }, "required": [ "type" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:formDefinition" }, "property": { "const": "formId" } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "not": { "required": [ "feel" ] } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:formDefinition" }, "property": { "enum": [ "externalReference", "formId" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text", "Dropdown" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:calledDecision" }, "property": { "const": "resultVariable" } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "not": { "required": [ "feel" ] } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:calledDecision" }, "property": { "enum": [ "resultVariable", "decisionId" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text", "Dropdown" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:script" }, "property": { "const": "resultVariable" } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "not": { "required": [ "feel" ] } } }, { "if": { "properties": { "type": { "enum": [ "String", "Text" ] }, "binding": { "properties": { "type": { "const": "zeebe:script" }, "property": { "const": "expression" } }, "required": [ "type", "property" ] } }, "required": [ "type", "binding" ] }, "then": { "properties": { "feel": { "enum": [ "required" ] } }, "required": [ "feel" ] } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:script" }, "property": { "enum": [ "resultVariable", "expression" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text", "Dropdown" ] } } } }, { "allOf": [ { "if": { "properties": { "binding": { "properties": { "property": { "const": "bindingType" }, "type": { "enum": [ "zeebe:calledDecision", "zeebe:formDefinition", "zeebe:calledElement", "zeebe:linkedResource" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type", "value" ], "properties": { "choices": { "type": "array", "items": { "properties": { "value": { "enum": [ "latest", "versionTag", "deployment" ] } } } }, "type": { "enum": [ "Hidden", "Dropdown" ] }, "value": { "enum": [ "latest", "versionTag", "deployment" ] } } } }, { "if": { "properties": { "binding": { "properties": { "property": { "const": "versionTag" }, "type": { "enum": [ "zeebe:calledDecision", "zeebe:formDefinition", "zeebe:calledElement", "zeebe:linkedResource" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "allOf": [ { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "Dropdown", "String", "Text" ] } } }, { "not": { "required": [ "feel" ] } } ] } } ] }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:assignmentDefinition" }, "property": { "enum": [ "assignee", "candidateUsers", "candidateGroups" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text", "Dropdown" ] } } } }, { "allOf": [ { "if": { "type": "object", "properties": { "binding": { "properties": { "type": { "const": "zeebe:priorityDefinition" }, "property": { "const": "priority" } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "anyOf": [ { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "Number", "Dropdown" ] } } }, { "required": [ "type", "feel" ], "properties": { "type": { "enum": [ "String", "Text" ] }, "feel": { "const": "required" } } } ] } }, { "if": { "type": "object", "properties": { "type": { "const": "Number" }, "binding": { "properties": { "type": { "const": "zeebe:priorityDefinition" }, "property": { "const": "priority" } }, "required": [ "type", "property" ] } }, "required": [ "binding", "value", "type" ] }, "then": { "properties": { "value": { "type": "integer", "minimum": 0, "maximum": 100 } } } }, { "if": { "type": "object", "properties": { "type": { "enum": [ "Hidden", "Dropdown" ] }, "binding": { "properties": { "type": { "const": "zeebe:priorityDefinition" }, "property": { "const": "priority" } }, "required": [ "type", "property" ] } }, "required": [ "binding", "type" ] }, "then": { "properties": { "value": { "type": "string", "pattern": "^(100|[1-9]?[0-9])$" }, "choices": { "items": { "properties": { "value": { "type": "string", "pattern": "^(100|[1-9]?[0-9])$" } } } } } } } ] }, { "allOf": [ { "$comment": "AdHoc output properties require string-based types (Hidden, String, Text, or Dropdown)", "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:adHoc" }, "property": { "enum": [ "outputCollection", "outputElement" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text", "Dropdown" ] } } } }, { "$comment": "outputCollection properties must not be FEEL expressions", "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:adHoc" }, "property": { "const": "outputCollection" } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "not": { "required": [ "feel" ] } } } ] }, { "allOf": [ { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:taskSchedule" }, "property": { "enum": [ "dueDate", "followUpDate" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Dropdown", "Text" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:taskSchedule" }, "property": { "enum": [ "dueDate", "followUpDate" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding", "value" ], "not": { "required": [ "feel" ] } }, "then": { "properties": { "value": { "type": "string", "pattern": "^(?<date>\\d{4}-(?<month>0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))T(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](Z|([+-](0[0-9]|1[0-3]):[0-5][0-9](\\[[^\\]]+\\])?))$", "description": "The value must be conforming to an ISO 8601 combined date and time representation." } }, "required": [ "value" ] } } ] }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "bpmn:Signal#property" } }, "required": [ "type" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "String", "Text", "Hidden", "Dropdown" ] } } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "zeebe:calledElement" }, "property": { "enum": [ "propagateAllParentVariables", "propagateAllChildVariables" ] } }, "required": [ "type", "property" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "Boolean" ] }, "value": { "type": "boolean" } }, "not": { "required": [ "feel" ] } } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "bpmn:TimerEventDefinition#property" }, "name": { "enum": [ "timeDate", "timeDuration", "timeCycle" ] } }, "required": [ "type", "name" ] } }, "required": [ "binding" ] }, "then": { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text" ] } } } }, { "allOf": [ { "if": { "properties": { "binding": { "properties": { "type": { "const": "bpmn:ConditionalEventDefinition#property" }, "name": { "const": "condition" } }, "required": [ "type", "name" ] } }, "required": [ "binding" ] }, "then": { "allOf": [ { "required": [ "type" ], "properties": { "type": { "enum": [ "Hidden", "String", "Text" ] } } }, { "required": [ "feel" ], "properties": { "feel": { "const": "required" } } } ] } }, { "if": { "properties": { "binding": { "properties": { "type": { "const": "bpmn:ConditionalEventDefinition#zeebe:conditionalFilter#property" },