Removing an element template from root element creates error
See original GitHub issueDescribe the Bug
When removing (not unlinking) an element template from a diagram root element (process or collaboration), an error occurs:
diagram_1.bpmn] Cannot read property 'children' of undefined
at BpmnOrderingProvider.getOrdering (webpack-internal:///./node_modules/bpmn-js/lib/features/ordering/BpmnOrderingProvider.js:148:34)
at eval (webpack-internal:///./node_modules/diagram-js/lib/features/ordering/OrderingProvider.js:53:25)
at invokeFunction (webpack-internal:///./node_modules/diagram-js/lib/core/EventBus.js:517:13)
at EventBus._invokeListener (webpack-internal:///./node_modules/diagram-js/lib/core/EventBus.js:368:19)
at EventBus._invokeListeners (webpack-internal:///./node_modules/diagram-js/lib/core/EventBus.js:349:24)
at EventBus.fire (webpack-internal:///./node_modules/diagram-js/lib/core/EventBus.js:310:24)
at CommandStack._fire (webpack-internal:///./node_modules/diagram-js/lib/command/CommandStack.js:356:29)
at CommandStack._internalExecute (webpack-internal:///./node_modules/diagram-js/lib/command/CommandStack.js:398:10)
at CommandStack.execute (webpack-internal:///./node_modules/diagram-js/lib/command/CommandStack.js:153:8)
at Modeling.createShape (webpack-internal:///./node_modules/diagram-js/lib/features/modeling/Modeling.js:310:22) [ error ]
Steps to Reproduce
- Set up some template for bpmn:Process:
[
{
"name": "KPI Template",
"id": "kpi",
"appliesTo": [
"bpmn:Collaboration","bpmn:Process","bpmn:Task","bpmn:IntermediateCatchEvent"
],
"properties": [
{
"label": "KPI Unit",
"type": "Dropdown",
"value": "ms",
"choices": [
{
"name": "Milliseconds", "value": "ms"
},
{
"name": "Seconds", "value": "s"
},
{
"name": "Minutes", "value": "m"
},
{
"name": "Hours", "value": "h"
}
],
"editable": true,
"binding": {
"type": "camunda:property",
"name": "kpiunit"
}
},
{
"label": "KPI Threshold",
"type": "String",
"value": "",
"editable": true,
"binding": {
"type": "camunda:property",
"name": "kpi"
}
}
]
}
]
- Apply element template to bpmn:Process
- Remove the element template again (by clicking on
Remove
)
Expected Behavior
Removal of element template from Process creates no error / diagram is still valid.
Environment
- OS: Arch Linux
- Camunda Modeler Version: 4.6.0 master branch on 2.March 2021
- Note: this fix is a precondition so to be able to reproduce this error: https://github.com/camunda/camunda-modeler/issues/2125
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Vue js error: Component template should contain exactly one ...
Currently, a VueJS template can contain only one root element (because of rendering issue); In cases you really need to have two root...
Read more >Map XML elements to cells in an XML Map - Microsoft Support
Learn about adding and removing XML mapping to an Excel workbook. ... Create an XML table by mapping the dataroot element. See Map...
Read more >23 Creating Template, CSElement, and SiteEntry Assets
The Cache Rules field has been simplified to reduce errors. ... The element in that CSElement asset becomes the root element for the...
Read more >TAL Reference — Page Templates 1.6 documentation
tal:omit-tag: remove an element, leaving the content of the element. tal:on-error: handle errors. tal:repeat: repeat an element ...
Read more >XSLT <xsl:template> Element - W3Schools
The match="/" attribute associates the template with the root of the XML source document. The content inside the <xsl:template> element defines some HTML...
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
I’d disable templates for root elements for now. Supporting them e2e including removal is not trivial and exceeds the initial scope of fixing a bug.
Nice Investigations @MaxTru 👏
I’d second @philippfromme @nikku 's opinion, if it’s too much hustle to support it, let’s not do it now. Your findings are a good starting point when we tackle it in the future.