@camunda/element-templates-json-schema
Version:
JSON Schema for (Camunda) Element Templates
1,200 lines • 41.9 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://camunda.org/schema/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"
]
}
},
{
"definitions": {
"condition": {
"type": "object",
"required": [
"property"
],
"properties": {
"type": {
"$id": "#/condition/type",
"const": "simple",
"description": "Defines the type of the condition (always \"simple\").",
"default": "simple"
},
"property": {
"$id": "#/condition/property",
"type": "string",
"description": "Reference to the property used to evaluate the condition."
}
},
"oneOf": [
{
"description": "Checks if the referenced property's value is in the list of values defined in the condition.",
"properties": {
"equals": {
"description": "Checks if the referenced property's value is equal to the value defined in the condition.",
"type": [
"string",
"number",
"boolean"
]
}
},
"required": [
"equals"
]
},
{
"properties": {
"oneOf": {
"type": "array",
"items": {
"type": [
"string",
"number"
]
}
}
},
"required": [
"oneOf"
]
},
{
"properties": {
"isActive": {
"type": "boolean",
"description": "Checks if the referenced property is currently active and not hidden by other conditions."
}
},
"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. Can be used to, for example, reference the property for checks."
},
"condition": {
"type": "object",
"description": "Object that defines when a property should be displayed in the properties panel and its value should be included in the XML.",
"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,
"description": "List of conditions that must all be met for the property to be active."
}
},
"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",
"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."
},
"condition": {
"$ref": "#/definitions/properties/allOf/0/items/allOf/1/properties/condition"
}
},
"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"
]
}
}
}
},
{
"if": {
"properties": {
"binding": {
"properties": {
"type": {
"const": "camunda:executionListener"
}
},
"required": [
"type"
]
}
},
"required": [
"binding"
]
},
"then": {
"properties": {
"type": {
"enum": [
"Hidden"
]
},
"binding": {
"properties": {
"implementationType": {
"enum": [
"class",
"delegateExpression",
"expression",
"script"
]
}
},
"oneOf": [
{
"not": {
"properties": {
"implementationType": {
"const": "script"
}
}
}
},
{
"required": [
"scriptFormat"
]
},
{
"allOf": [
{
"not": {
"required": [
"implementationType"
]
}
},
{
"not": {
"required": [
"scriptFormat"
]
}
}
]
}
]
}
}
}
},
{
"if": {
"properties": {
"binding": {
"properties": {
"type": {
"enum": [
"camunda:property",
"camunda:outputParameter",
"camunda:in",
"camunda:in:businessKey",
"camunda:out",
"camunda:errorEventDefinition"
]
}
},
"required": [
"type"
]
}
},
"required": [
"binding"
]
},
"then": {
"properties": {
"type": {
"enum": [
"String",
"Hidden",
"Dropdown"
]
}
}
}
},
{
"if": {
"properties": {
"binding": {
"properties": {
"type": {
"enum": [
"camunda:inputParameter",
"camunda:field"
]
}
},
"required": [
"type"
]
}
},
"required": [
"binding"
]
},
"then": {
"properties": {
"type": {
"enum": [
"String",
"Text",
"Hidden",
"Dropdown"
]
}
}
}
}
],
"properties": {
"binding": {
"$id": "#/properties/property/binding",
"type": "object",
"description": "Object that defines how the property is mapped to BPMN or Camunda extensions. Required.",
"required": [
"type"
],
"allOf": [
{
"if": {
"properties": {
"type": {
"enum": [
"property",
"camunda:property",
"camunda:inputParameter",
"camunda:field"
]
}
},
"required": [
"type"
]
},
"then": {
"required": [
"name"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "camunda:outputParameter"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"source"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "camunda:in"
}
},
"required": [
"type"
]
},
"then": {
"anyOf": [
{
"required": [
"variables"
]
},
{
"required": [
"target"
]
}
]
}
},
{
"if": {
"properties": {
"type": {
"const": "camunda:out"
}
},
"required": [
"type"
]
},
"then": {
"oneOf": [
{
"required": [
"variables"
],
"not": {
"anyOf": [
{
"required": [
"source"
]
},
{
"required": [
"sourceExpression"
]
}
]
}
},
{
"required": [
"source"
],
"not": {
"anyOf": [
{
"required": [
"variables"
]
},
{
"required": [
"sourceExpression"
]
}
]
}
},
{
"required": [
"sourceExpression"
],
"not": {
"anyOf": [
{
"required": [
"variables"
]
},
{
"required": [
"source"
]
}
]
}
},
{
"required": [
"variables",
"sourceExpression"
],
"not": {
"required": [
"source"
]
}
},
{
"required": [
"variables",
"source"
],
"not": {
"required": [
"sourceExpression"
]
}
}
]
}
},
{
"if": {
"properties": {
"type": {
"const": "camunda:errorEventDefinition"
}
},
"required": [
"type"
]
},
"then": {
"oneOf": [
{
"required": [
"errorRef"
]
}
]
}
},
{
"examples": [
{
"type": "property",
"name": "name"
},
{
"type": "camunda:property",
"name": "property"
},
{
"type": "camunda:inputParameter",
"name": "input"
},
{
"type": "camunda:outputParameter",
"source": "output"
},
{
"type": "camunda:in",
"target": "target"
},
{
"type": "camunda:in:businessKey"
},
{
"type": "camunda:out",
"source": "output"
},
{
"type": "camunda:executionListener",
"event": "start"
},
{
"type": "camunda:field",
"name": "field"
},
{
"type": "camunda:errorEventDefinition",
"errorRef": "error"
},
{
"type": "camunda:errorEventDefinition",
"errorRef": "error"
}
]
}
],
"properties": {
"type": {
"$id": "#/properties/property/binding/type",
"type": "string",
"enum": [
"property",
"camunda:property",
"camunda:inputParameter",
"camunda:outputParameter",
"camunda:in",
"camunda:out",
"camunda:in:businessKey",
"camunda:executionListener",
"camunda:field",
"camunda:errorEventDefinition"
],
"description": "The type of a property binding."
},
"name": {
"$id": "#/properties/property/binding/name",
"type": "string",
"description": "The name of a property binding."
},
"event": {
"$id": "#/properties/property/binding/event",
"type": "string",
"description": "The event type of a property binding (camunda:executionListener)."
},
"scriptFormat": {
"$id": "#/properties/property/binding/scriptFormat",
"type": "string",
"description": "The script format of a property binding (camunda:outputParameter, camunda:inputParameter)."
},
"source": {
"$id": "#/properties/property/binding/source",
"type": "string",
"description": "The source value of a property binding (camunda:outputParameter, camunda:out)."
},
"target": {
"$id": "#/properties/property/binding/target",
"type": "string",
"description": "The target value of a property binding (camunda:in)."
},
"expression": {
"$id": "#/properties/property/binding/expression",
"type": "boolean",
"description": "Indicates whether the control field value is an expression (camunda:in, camunda:field)."
},
"variables": {
"$id": "#/properties/property/binding/variables",
"type": "string",
"enum": [
"all",
"local"
],
"description": "The variable mapping of a property binding (camunda:in)."
},
"sourceExpression": {
"$id": "#/properties/property/binding/sourceExpression",
"type": "string",
"description": "The string containing the expression for the source attribute (camunda:out)."
}
}
}
}
}
}
]
},
"template": {
"type": "object",
"allOf": [
{
"required": [
"name",
"id",
"appliesTo",
"properties"
],
"properties": {
"$schema": {
"$id": "#/$schema",
"type": "string",
"description": "Reference to the Element Template JSON schema this document follows."
},
"name": {
"$id": "#/name",
"type": "string",
"description": "Template name. Shown during template selection and editing of a templated element. Required."
},
"id": {
"$id": "#/id",
"type": "string",
"description": "Template identifier. Required."
},
"description": {
"$id": "#/description",
"type": "string",
"description": "Template description. Shown during template selection and editing of a templated element."
},
"version": {
"$id": "#/version",
"type": "integer",
"description": "Optional version of the template. If you add a version to a template, it will be considered unique based on its ID and version. Two templates can have the same ID if their versions are different."
},
"isDefault": {
"$id": "#/isDefault",
"type": "boolean",
"description": "Indicates whether the element template is a default template."
},
"deprecated": {
"$id": "#/deprecated",
"type": [
"boolean",
"object"
],
"description": "Marks the template as deprecated. Value can be either a boolean or an object with a message and a link to migration documentation.",
"properties": {
"message": {
"$id": "#/deprecated/message",
"type": "string",
"description": "Optional message to describe migration path."
},
"documentationRef": {
"$id": "#/deprecated/documentationRef",
"type": "string",
"pattern": "^(https|http)://.*",
"description": "URL pointing to template documentation. Must be a valid http(s) URL."
}
}
},
"appliesTo": {
"$id": "#/appliesTo",
"type": "array",
"description": "List of BPMN types the template can be applied to. Required.",
"default": [],
"items": {
"$id": "#/appliesTo/items",
"type": "string",
"pattern": "^[\\w\\d]+:[\\w\\d]+$",
"allOf": [
{
"examples": [
"bpmn:Task",
"bpmn:ServiceTask",
"bpmn:SequenceFlow",
"bpmn:Process",
"bpmn:StartEvent",
"bpmn:Gateway"
]
}
]
}
},
"elementType": {
"$id": "#/elementType",
"type": "object",
"description": "Object that sets the type of the element. Some properties require a specific value for elementType.",
"default": {},
"required": [
"value"
],
"properties": {
"value": {
"$id": "#/elementType/value",
"type": "string",
"pattern": "^[\\w\\d]+:[\\w\\d]+$",
"description": "Specifies the target BPMN element type. The element is replaced with the specified type when a user applies the template. Required if using elementType.",
"allOf": [
{
"examples": [
"bpmn:ServiceTask",
"bpmn:UserTask",
"bpmn:StartEvent",
"bpmn:ExclusiveGateway",
"bpmn:ParallelGateway"
]
}
]
}
}
},
"metadata": {
"$id": "#/metadata",
"type": "object",
"description": "Some custom properties for further configuration.",
"default": {}
},
"keywords": {
"$id": "#/keywords",
"type": "array",
"items": {
"type": "string"
},
"description": "List of keywords to help users find the template. Used in search and filtering, but not displayed in the UI.",
"default": []
},
"groups": {
"$id": "#/groups",
"type": "array",
"description": "List of custom groups to organize related fields in the properties panel.",
"allOf": [
{
"examples": [
[
{
"id": "group-1",
"label": "My Group"
}
]
]
}
],
"items": {
"$id": "#/groups/group",
"type": "object",
"default": {},
"required": [
"id",
"label"
],
"properties": {
"id": {
"$id": "#/groups/group/id",
"type": "string",
"description": "Uniquely identifies a group object. Required if using groups."
},
"label": {
"$id": "#/groups/group/label",
"type": "string",
"description": "The label of the group, shown as a section header in the properties panel. Required if using groups."
}
}
}
},
"documentationRef": {
"$id": "#/documentationRef",
"type": "string",
"pattern": "^(https|http)://.*"
}
}
}
],
"properties": {
"properties": {
"$ref": "#/definitions/properties",
"$id": "#/properties"
},
"scopes": {
"$id": "#/scopes",
"type": "array",
"description": "Special scoped bindings that allow you to configure nested elements.",
"allOf": [
{
"examples": [
[
{
"type": "bpmn:Error",
"id": "Error_1",
"properties": [
{
"value": "error-code",
"binding": {
"type": "property",
"name": "errorCode"
}
},
{
"value": "error-message",
"binding": {
"type": "property",
"name": "camunda:errorMessage"
}
},
{
"value": "error-name",
"binding": {
"type": "property",
"name": "name"
}
}
]
}
]
]
}
],
"items": {
"$id": "#/scopes/item",
"type": "object",
"default": {},
"properties": {
"type": {
"$id": "#scopes/item/type",
"type": "string",
"description": "The type of a scope.",
"enum": [
"camunda:Connector",
"bpmn:Error"
]
},
"properties": {
"$id": "#/scopes/properties",
"description": "List of properties of a scope.",
"default": [],
"allOf": [
{
"$ref": "#/definitions/properties/allOf/0"
},
{
"$ref": "#/definitions/properties/allOf/1"
}
]
}
},
"required": [
"type",
"properties"
],
"allOf": [
{
"if": {
"properties": {
"type": {
"enum": [
"bpmn:Error"
]
}
},
"required": [
"type"
]
},
"then": {
"required": [
"id"
]
}
}
]
}
},
"entriesVisible": {
"$id": "#/entriesVisible",
"type": "boolean",
"description": "Defines whether all property input fields are shown, even those normally hidden by the template."
}
}
}
},
"oneOf": [
{
"description": "An element template configuration.",
"$ref": "#/definitions/template"
},
{
"type": "array",
"description": "A list of element template configurations.",
"items": {
"$ref": "#/definitions/template"
}
}
]
}