Applied Element Template is not unlinked, when changing to not supported element type
See original GitHub issueDescribe the Enhancement
When applying an task-specific element template to a task of a specific type (e.g., ServiceTask
) and then changing the type of the respective task (e.g., to UserTask
), the element template is still present. This is IMO an inconsistent state, since the element template configuration would not allow that template to be applied to a task other than ServiceTask
.
Steps to Reproduce
- Setup the following example element template
{
"name": "Mail Task",
"id": "com.camunda.example.MailTask",
"appliesTo": [
"bpmn:ServiceTask"
],
"properties": [
{
"label": "Implementation Type",
"type": "String",
"value": "com.mycompany.MailTaskImpl",
"editable": false,
"binding": {
"type": "property",
"name": "camunda:class"
}
},
{
"label": "Sender",
"type": "String",
"binding": {
"type": "camunda:inputParameter",
"name": "sender"
},
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^[A-z0-9._%+-]+@[A-z0-9.-]+\\.[A-z]{2,}$",
"message": "Must be a valid email."
}
}
},
{
"label": "Receivers",
"type": "String",
"binding": {
"type": "camunda:inputParameter",
"name": "receivers"
},
"constraints": {
"notEmpty": true
}
},
{
"label": "Template",
"description": "By the way, you can use <a href=\"https://freemarker.apache.org/\">freemarker templates</a> here",
"value": "Hello ${firstName}!",
"type": "Text",
"binding": {
"type": "camunda:inputParameter",
"name": "messageBody",
"scriptFormat": "freemarker"
},
"constraints": {
"notEmpty": true
}
},
{
"label": "Result Status",
"description": "The process variable to which to assign the send result to",
"type": "String",
"value": "mailSendResult",
"binding": {
"type": "camunda:outputParameter",
"source": "${ resultStatus }"
}
},
{
"label": "Send Async?",
"type": "Boolean",
"value": true,
"binding": {
"type": "property",
"name": "camunda:asyncBefore"
}
}
]
}
- Apply the template to a
serviceTask
- Change the task type to
userTask
- => The element template is still applied
Expected Behavior
The element template shall be unlinked, if not supporting the respective new task type.
Why
If we don’t have this, the user would get to an inconsistent state of the diagram (according to the element template configuration)
Environment
- OS: Arch Linux Manjaro
- Camunda Modeler Version: develop branch + develop branch bpmn-js-properties-panel on 6th October
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Global Elements | Use containers + unlink global
This way, the template gets inserted directly as individual elements. So changing the template (in Bricks > Templates) will not affect it.
Read more >2 Linking/unlinking - Zabbix
To link a template to the host, do the following: Go to Configuration → Hosts; Click on the required host; Start typing the...
Read more >Components | Webflow University
Components allow you to maintain a consistent, efficient, and scalable design workflow by creating customizable blocks from elements and child elements.
Read more >dom-repeat – API Reference - Polymer Project
The <dom-repeat> element will automatically stamp and binds one instance of ... on properties not contained in items , the user should observe...
Read more >Cover Creator - Amazon Kindle Direct Publishing
Note: Cover Creator does not support Japanese, Hebrew, and Yiddish. ... click anywhere on the cover, except where other elements (e.g., text boxes)...
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
The solution I’ve discussed with @azeghers is:
CodeSandbox example: https://codesandbox.io/s/restricting-camundamodelertemplate-nyrtp?file=/src/index.js
Closed via https://github.com/camunda/camunda-modeler/commit/d03c2a69a1adc4dcf236afd049b195e40e098a77