question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing element template clears existing, compatible binding values

See original GitHub issue

Describe the Bug

As I’m using element templates and switch between different templates (i.e. using ElementTemplates#applyTemplate) the implementation clears compatible values, if they match the existing template default.

capture 1uuk08_optimized

Steps to Reproduce

template-1

{
  "value": "https://foobar",
  "binding": {
    "type": "zeebe:input",
    "name": "url"
  }
}

template-2

{
  "value": "= other",
  "binding": {
    "type": "zeebe:input",
    "name": "url"
  }
}
  • Given I have template-1 with zeebe:input#url = "https://foobar applied
  • When I change to template-2 zeebe:input#url = "= other is set, despite the existing binding being valid in the context of template-2

Expected Behavior

Compatible, existing binding values are kept as I change the template.

Environment

  • Host (Browser/Node version), if applicable: Any
  • OS: Any
  • Library version: v1.0.0-alpha.7 (latest) but also master

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
nikkucommented, Apr 27, 2022

@marstamm Assigned you as we agreed on you’ll wrap this topic up via https://github.com/bpmn-io/bpmn-js-properties-panel/pull/661.

1reaction
marstammcommented, Apr 26, 2022

IMO, these are possible scenarios for Element Templates that we should cover (and add Integration Test for):

  • ServiceTask -> Element Template
    • Existing values are kept
    • defaults added when nothing exists
    • hidden values always override
  • Element Template A -> Element Template B
    • Existing values are kept
    • new defaults override existing defaults (if no custom value was added)
    • hidden values always override
  • Element Template v1 -> Element Template v2
    • Same as different Templates
  • Element Template -> Service Task
    • keep all values
  • Element Template -> Service Task -> Element Template
    • Round trip should end with the start configuration (keep everything)
    • If defaults were cleared, they will be added when applied
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Content Template element - HTML - MDN Web Docs
The HTML element is a mechanism for holding HTML that is not to be rendered immediately when a page is loaded but may...
Read more >
Template syntax reference - Lit.dev
Templates must be well-formed HTML when all expressions are replaced by empty values. Bindings can only occur in attribute-value and text-content positions.
Read more >
Applying Data Binding for Views | CodePath Android Cliffnotes
Be sure to Project -> Clean Project and Project -> Rebuild Project the project in order to regenerate the binding classes with latest...
Read more >
ASP.NET Core Blazor data binding - Microsoft Learn
Learn about data binding features for Razor components and Document Object Model (DOM) elements in Blazor apps.
Read more >
How to Implement DOM Data Binding in JavaScript
MyCtor.prototype.handleEvent = function(event) { switch (event.type) { case "change": this.change(this.element.value); } }; MyCtor.prototype.change = function( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found