@camunda/zeebe-element-templates-json-schema
Version:
JSON Schema for (Zeebe) Element Templates
1,557 lines (1,556 loc) • 98 kB
JSON
{
"$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 properties of the element template.",
"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"
]
}
},
{
"definitions": {
"condition": {
"type": "object",
"required": [
"property"
],
"properties": {
"type": {
"$id": "#/condition/type",
"const": "simple",
"description": "The type of the condition.",
"default": "simple"
},
"property": {
"$id": "#/condition/property",
"type": "string",
"description": "The id of the property to check."
}
},
"oneOf": [
{
"properties": {
"equals": {
"type": [
"string",
"number",
"boolean"
]
}
},
"required": [
"equals"
]
},
{
"properties": {
"oneOf": {
"type": "array",
"items": {
"type": [
"string",
"number"
]
}
}
},
"required": [
"oneOf"
]
},
{
"properties": {
"isActive": {
"type": "boolean",
"description": "For `true`, activates the property when given property is active"
}
},
"required": [
"isActive"
]
}
]
},
"conditionDependingOnId": {
"required": [
"property"
],
"properties": {
"property": {
"const": {
"$data": "2/id"
}
}
}
}
},
"allOf": [
{
"$comment": "property#condition should not depend on property#id",
"if": {
"required": [
"id",
"condition"
],
"properties": {
"condition": {
"$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/conditionDependingOnId"
}
}
},
"then": {
"not": {
"required": [
"condition"
]
}
}
}
],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the property."
},
"condition": {
"type": "object",
"description": "Condition(s) to activate the binding.",
"allOf": [
{
"examples": [
{
"type": "simple",
"property": "httpMethod",
"equals": "GET"
},
{
"type": "simple",
"property": "httpMethod",
"oneOf": [
"POST",
"PUT",
"DELETE"
]
},
{
"allMatch": [
{
"type": "simple",
"property": "authType",
"equals": "Basic"
},
{
"type": "simple",
"property": "httpMethod",
"oneOf": [
"POST",
"PUT",
"DELETE"
]
}
]
}
]
}
],
"oneOf": [
{
"$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/condition"
},
{
"properties": {
"allMatch": {
"$id": "#/allMatch",
"type": "array",
"items": {
"$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/condition"
},
"minItems": 1
}
},
"required": [
"allMatch"
]
}
]
}
}
},
{
"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"
}
}
},
"else": {
"not": {
"required": [
"placeholder"
]
}
}
}
],
"properties": {
"value": {
"$id": "#/properties/property/value",
"type": [
"string",
"number",
"boolean"
],
"description": "The value of a control field."
},
"description": {
"$id": "#/properties/property/description",
"type": "string",
"description": "The description of a control field."
},
"label": {
"$id": "#/properties/property/label",
"type": "string",
"description": "The label of a control field."
},
"type": {
"$id": "#/properties/property/type",
"type": "string",
"description": "The type of a control field."
},
"editable": {
"$id": "#/properties/property/editable",
"type": "boolean",
"description": "Indicates whether a control field is editable or not."
},
"choices": {
"$id": "#/properties/property/choices",
"type": "array",
"description": "The choices for dropdown fields.",
"default": [],
"items": {
"$id": "#/properties/property/choices/item",
"type": "object",
"default": {},
"properties": {
"name": {
"$id": "#/properties/property/choices/item/name",
"type": "string",
"description": "The name of a choice."
},
"value": {
"$id": "#/properties/property/choices/item/value",
"type": "string",
"description": "The value of a choice."
},
"condition": {
"$ref": "#/definitions/properties/allOf/0/items/allOf/1/properties/condition"
}
},
"required": [
"value",
"name"
]
}
},
"constraints": {
"$id": "#/properties/property/constraints",
"type": "object",
"description": "The validation constraints of a control field.",
"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": "A regular expression pattern for a constraint.",
"oneOf": [
{
"type": "object",
"default": {},
"properties": {
"value": {
"$id": "#/properties/property/constraints/pattern/value",
"type": "string",
"description": "The regular expression of a pattern."
},
"message": {
"$id": "#/properties/property/constraints/pattern/message",
"type": "string",
"description": "The validation message of a pattern."
}
}
},
{
"type": "string"
}
]
}
}
},
"group": {
"$id": "#/properties/property/group",
"type": "string",
"description": "The custom group of a control field."
}
}
}
},
{
"$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"
]
}
},
"required": [
"type"
]
}
},
"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": {
"type": "string"
}
}
}
},
{
"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"
]
}
}
}
}
],
"properties": {
"binding": {
"$id": "#/properties/property/binding",
"type": "object",
"description": "Specifying how the property is mapped to BPMN or Zeebe extension elements and attributes.",
"required": [
"type"
],
"allOf": [
{
"if": {
"properties": {
"type": {
"enum": [
"property",
"zeebe:property",
"zeebe:input",
"bpmn:Message#property",
"bpmn:Message#zeebe:subscription#property"
]
}
},
"required": [
"type"
]
},
"then": {
"required": [
"name"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:output"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"source"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:taskHeader"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"key"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:taskDefinition"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"type",
"retries"
]
}
},
"required": [
"property"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:taskDefinition:type"
}
},
"required": [
"type"
]
},
"then": {
"deprecated": true
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:calledElement"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"processId",
"bindingType",
"versionTag"
]
}
},
"required": [
"property"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:script"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"expression",
"resultVariable"
]
}
},
"required": [
"property"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:formDefinition"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"formId",
"externalReference",
"bindingType",
"versionTag"
]
}
},
"required": [
"property"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:calledDecision"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"decisionId",
"resultVariable",
"versionTag",
"bindingType"
]
}
},
"required": [
"property"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "zeebe:assignmentDefinition"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"property": {
"enum": [
"assignee",
"candidateUsers",
"candidateGroups"
]
}
},
"required": [
"property"
]
}
},
{
"examples": [
{
"type": "property",
"name": "name"
},
{
"type": "zeebe:input",
"name": "input"
},
{
"type": "zeebe:output",
"source": "output"
},
{
"type": "zeebe:property",
"name": "property"
},
{
"type": "zeebe:taskHeader",
"key": "key"
},
{
"type": "zeebe:taskDefinition",
"property": "retries"
},
{
"type": "zeebe:taskDefinition",
"property": "type"
}
]
}
],
"properties": {
"type": {
"$id": "#/properties/property/binding/type",
"type": "string",
"description": "The type of a property binding.",
"enum": [
"property",
"zeebe:taskDefinition:type",
"zeebe:input",
"zeebe:output",
"zeebe:property",
"zeebe:taskHeader",
"bpmn:Message#property",
"bpmn:Message#zeebe:subscription#property",
"zeebe:taskDefinition",
"zeebe:calledElement",
"zeebe:linkedResource",
"zeebe:userTask",
"zeebe:formDefinition",
"zeebe:calledDecision",
"zeebe:script",
"zeebe:assignmentDefinition"
]
},
"name": {
"$id": "#/properties/property/binding/name",
"type": "string",
"description": "The name of a property binding."
},
"source": {
"$id": "#/properties/property/binding/source",
"type": "string",
"description": "The source value of a property binding (zeebe:output)."
},
"key": {
"$id": "#/properties/property/binding/key",
"type": "string",
"description": "The key value of a property binding (zeebe:taskHeader)."
},
"property": {
"$id": "#/properties/property/binding/property",
"type": "string",
"description": "The name of the property defined in the binding."
},
"linkName": {
"$id": "#/properties/property/binding/linkName",
"type": "string",
"description": "The `linkName` of the element (zeebe:linkedResource)."
}
}
},
"optional": {
"$id": "#/optional",
"type": "boolean",
"description": "Indicates whether a property is optional. Optional bindings do not persist empty values in the underlying BPMN 2.0 XML."
},
"feel": {
"$id": "#/properties/property/feel",
"type": "string",
"description": "Indicates whether the property can be a feel expression",
"enum": [
"optional",
"required",
"static"
]
},
"language": {
"$id": "#/properties/property/language",