-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to bpmn-io/bpmn-js-properties-panel#561
- Loading branch information
1 parent
73ef400
commit 1a9d15c
Showing
16 changed files
with
1,780 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "http://camunda.org/schema/cloud-element-templates/1.0", | ||
"title": "Cloud Element Template Schema", | ||
"description": "A single element template configuration or an array of element template configurations", | ||
"definitions": { | ||
"properties": { | ||
"allOf": [ | ||
{ | ||
"$ref": "src/defs/base-properties.json" | ||
}, | ||
{ | ||
"$ref": "src/defs/cloud-properties.json" | ||
} | ||
] | ||
}, | ||
"template": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "src/defs/base.json" | ||
} | ||
], | ||
"properties": { | ||
"properties": { | ||
"$ref": "#/definitions/properties", | ||
"$id": "#/properties" | ||
} | ||
} | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/template" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/template" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "array", | ||
"title": "element template properties", | ||
"description": "The properties of the element template", | ||
"default": [], | ||
"items": { | ||
"type": "object", | ||
"title": "element template property", | ||
"description": "A property defined for the element template", | ||
"default": {}, | ||
"required": [ | ||
"binding" | ||
], | ||
"errorMessage": { | ||
"required": { | ||
"binding": "missing binding for property \"${0#}\"" | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"properties": { | ||
"binding": { | ||
"properties": { | ||
"type": { | ||
"const": "property" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"binding" | ||
] | ||
}, | ||
"then": { | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"String", | ||
"Text", | ||
"Hidden", | ||
"Dropdown", | ||
"Boolean" | ||
], | ||
"errorMessage": "invalid property type ${0} for binding type \"property\"; must be any of { String, Text, Hidden, Dropdown, Boolean }" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"binding": { | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"zeebe:input", | ||
"zeebe:output", | ||
"zeebe:taskHeader", | ||
"zeebe:taskDefinition:type" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"binding" | ||
] | ||
}, | ||
"then": { | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"String", | ||
"Text", | ||
"Hidden", | ||
"Dropdown" | ||
], | ||
"errorMessage": "invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Text, Hidden, Dropdown }" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"optional": { | ||
"const": true | ||
} | ||
}, | ||
"required": [ | ||
"optional" | ||
] | ||
}, | ||
"then": { | ||
"properties": { | ||
"binding": { | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"zeebe:input", | ||
"zeebe:output" | ||
], | ||
"errorMessage": "optional is not supported for binding type ${0}; must be any of { zeebe:input, zeebe:output }" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"properties": { | ||
"binding": { | ||
"$id": "#/properties/property/binding", | ||
"type": "object", | ||
"title": "property binding", | ||
"description": "A binding to a BPMN 2.0 property", | ||
"required": [ | ||
"type" | ||
], | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"property", | ||
"zeebe:input" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
}, | ||
"then": { | ||
"required": [ | ||
"name" | ||
], | ||
"errorMessage": "property.binding ${0/type} requires name" | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"const": "zeebe:output" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
}, | ||
"then": { | ||
"required": [ | ||
"source" | ||
], | ||
"errorMessage": "property.binding ${0/type} requires source" | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"const": "zeebe:taskHeader" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
}, | ||
"then": { | ||
"required": [ | ||
"key" | ||
], | ||
"errorMessage": "property.binding ${0/type} requires key" | ||
} | ||
} | ||
], | ||
"properties": { | ||
"type": { | ||
"$id": "#/properties/property/binding/type", | ||
"type": "string", | ||
"title": "property binding type", | ||
"enum": [ | ||
"property", | ||
"zeebe:taskDefinition:type", | ||
"zeebe:input", | ||
"zeebe:output", | ||
"zeebe:taskHeader" | ||
], | ||
"errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:taskHeader }", | ||
"description": "The type of the property binding" | ||
}, | ||
"name": { | ||
"$id": "#/properties/property/binding/name", | ||
"type": "string", | ||
"title": "property binding name", | ||
"description": "The name of binding xml property" | ||
}, | ||
"source": { | ||
"$id": "#/properties/property/binding/source", | ||
"type": "string", | ||
"title": "property binding source", | ||
"description": "The source value of a property binding (zeebe:output)" | ||
}, | ||
"key": { | ||
"$id": "#/properties/property/binding/key", | ||
"type": "string", | ||
"title": "property binding key", | ||
"description": "The key value of a property binding (zeebe:taskHeader)" | ||
} | ||
} | ||
}, | ||
"optional": { | ||
"$id": "#/optional", | ||
"type": "boolean", | ||
"title": "element template optional", | ||
"description": "Indicates whether a property is optional" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const template = { | ||
'name': 'REST Connector', | ||
'id': 'io.camunda.connectors.RestConnector-s1', | ||
'description': 'A generic REST service.', | ||
'appliesTo': [ | ||
'bpmn:ServiceTask' | ||
], | ||
'properties': [ | ||
{ | ||
'label': 'Request Body', | ||
'type': 'String', | ||
'optional': true, | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'body' | ||
} | ||
}, | ||
{ | ||
'label': 'Result Variable', | ||
'type': 'String', | ||
'optional': true, | ||
'binding': { | ||
'type': 'zeebe:output', | ||
'source': '= body' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
export const template = { | ||
'name': 'REST Connector', | ||
'id': 'io.camunda.connectors.RestConnector-s1', | ||
'description': 'A generic REST service.', | ||
'appliesTo': [ | ||
'bpmn:ServiceTask' | ||
], | ||
'properties': [ | ||
{ | ||
'label': 'Request Body', | ||
'type': 'String', | ||
'optional': true, | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'body' | ||
} | ||
}, | ||
{ | ||
'label': 'Result Variable', | ||
'type': 'String', | ||
'optional': true, | ||
'binding': { | ||
'type': 'zeebe:taskHeader', | ||
'key': 'key' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
keyword: 'errorMessage', | ||
dataPath: '/properties/1/binding/type', | ||
schemaPath: '#/definitions/properties/allOf/1/items/allOf/2/then/properties/binding/properties/type/errorMessage', | ||
params: { | ||
errors: [ | ||
{ | ||
keyword: 'enum', | ||
dataPath: '/properties/1/binding/type', | ||
schemaPath: '#/definitions/properties/allOf/1/items/allOf/2/then/properties/binding/properties/type/enum', | ||
params: { allowedValues: [ 'zeebe:input', 'zeebe:output' ] }, | ||
message: 'should be equal to one of the allowed values', | ||
emUsed: true | ||
} | ||
] | ||
}, | ||
message: 'optional is not supported for binding type "zeebe:taskHeader"; must be any of { zeebe:input, zeebe:output }' | ||
}, | ||
{ | ||
keyword: 'if', | ||
dataPath: '/properties/1', | ||
schemaPath: '#/definitions/properties/allOf/1/items/allOf/2/if', | ||
params: { failingKeyword: 'then' }, | ||
message: 'should match "then" schema' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { type: 'array' }, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { passingSchemas: null }, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
Oops, something went wrong.