@camunda/element-templates-json-schema
Version:
JSON Schema for (Camunda) Element Templates
1,181 lines • 39.6 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 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"
]
}
}
}
},
{
"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": "Specifying how the property is mapped to BPMN or Camunda extension elements and attributes.",
"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": {
"name": {
"$id": "#/name",
"type": "string",
"description": "The name of the element template."
},
"id": {
"$id": "#/id",
"type": "string",
"description": "The identifier of the element template."
},
"description": {
"$id": "#/description",
"type": "string",
"description": "The description of the element template."
},
"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 version is different."
},
"isDefault": {
"$id": "#/isDefault",
"type": "boolean",
"description": "Indicates whether the element template is a default template."
},
"deprecated": {
"$id": "#/deprecated",
"type": [
"boolean",
"object"
],
"description": "Indicates whether the element template is deprecated.",
"properties": {
"message": {
"$id": "#/deprecated/message",
"type": "string",
"description": "Optional message to describe migration path."
},
"documentationRef": {
"$id": "#/deprecated/documentationRef",
"type": "string",
"pattern": "^(https|http)://.*",
"description": "Optional link to migration documentation."
}
}
},
"appliesTo": {
"$id": "#/appliesTo",
"type": "array",
"description": "List of BPMN types the template can be applied to.",
"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": "The BPMN type the element will be transformed into.",
"default": {},
"required": [
"value"
],
"properties": {
"value": {
"$id": "#/elementType/value",
"type": "string",
"pattern": "^[\\w\\d]+:[\\w\\d]+$",
"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": {}
},
"entriesVisible": {
"$id": "#/entriesVisible",
"type": "boolean",
"description": "Select whether non-template entries are visible in the properties panel."
},
"groups": {
"$id": "#/groups",
"type": "array",
"description": "Custom fields can be ordered together via groups.",
"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": "The id of the custom group"
},
"label": {
"$id": "#/groups/group/label",
"type": "string",
"description": "The label of the custom group"
}
}
}
},
"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"
]
}
}
]
}
}
}
}
},
"oneOf": [
{
"description": "An element template configuration.",
"$ref": "#/definitions/template"
},
{
"type": "array",
"description": "A list of element template configurations.",
"items": {
"$ref": "#/definitions/template"
}
}
]
}