Introduce schema-version for element templates
See original GitHub issueWhat should we do?
Currently, element templates don’t define a schema or schema-version that they adhere to.
This creates challenges:
- When we are changing element templates, these might not work in older Modeler version. Hence when loading these element templates, the Camunda Modeler will just throw a generic error message.
However, a solution is already available: the https://github.com/camunda/element-templates-json-schema repo defines a versioned schema, which can be used to…
- verify the validity of a given element template
- ensure that only element templates, which are supported in the current Camunda Modeler version, are loaded.
This issue proposes the following changes:
Prio 1
-
Add https://github.com/camunda/element-templates-json-schema as dependency - Element template schema json shall allow multiple element templates in an array as valid json (https://github.com/camunda/element-templates-json-schema/issues/15)
- Release + integrate a version 0.3.0 of https://github.com/camunda/element-templates-json-schema, which includes the element templates changes introduced here: https://github.com/camunda/camunda-modeler/issues/2070
- Update element templates to include a new field:
"$schema": "https://unpkg.com/@camunda/element-templates-json-schema@0.2.0/resources/schema.json"
(https://github.com/camunda/camunda-modeler/pull/2102) - Explicitly define in the codeBase, which element-template versions are supported (https://github.com/bpmn-io/bpmn-js-properties-panel/pull/431)
- When loading an element template, check the version compatability. If incompatabile, ignore the respective element template giving a meaningful notifaction (ala. “Vx.y.z of element templates is not supported, please update your Camunda Modeler to the latest version”). With the first release, support version
0.2.0
and yet to be released version0.3.0
(https://github.com/bpmn-io/bpmn-js-properties-panel/pull/431) - Update the element template docs (https://github.com/camunda/camunda-modeler/issues/2161)
Prio 2
-
Validate the element template before applying it using https://github.com/bpmn-io/json-schema-validator and print the error to the user (if any)(Will be tracked in https://github.com/camunda/camunda-modeler/issues/2159)
Example
[
{
"$schema": "https://unpkg.com/@camunda/element-templates-json-schema@0.2.0/resources/schema.json",
"name": "Template 1",
"id": "sometemplate",
"version": 1,
"appliesTo": [
"bpmn:ServiceTask"
],
"properties": [
...
]
},
{
"name": "Template 2",
...
}
]
Why should we do it?
This change will help us to manage changes in element templates in a more user-friendly way.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
SSM document schema features and examples
Documents of type Command can use schema version 1.2, 2.0, and 2.2. ... example shows the top-level elements of an SSM document using...
Read more >Defining templates - Camunda Platform 8 Docs
In case no $schema is defined, Camunda Modeler assumes the latest JSON Schema version for Camunda Platform 7 element templates. Learn more about...
Read more >XML schema Element - W3Schools
This declaration tells the schema-validator that all the elements used in this XML document are declared in the "https://www.w3schools.com" namespace. Once you ...
Read more >Introducing Custom Elements Manifest - Open Web Components
A custom-elements.json contains metadata about the custom elements in your project; their properties, methods, attributes, inheritance, slots, ...
Read more >AF Element Template Versioning - PI Square - OSIsoft
Is there any reason why AF Element Templates do not have their own ... There are also performance reasons to not introduce versioning...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Only thing missing: update of docs
Did final smoke test including:
Great job everyone! Closing this issue (as @nikku stated, documentation is tracked seperately)