camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.51k stars 484 forks source link

Camunda 7 element template properties overridden on update #4679

Open philippfromme opened 2 weeks ago

philippfromme commented 2 weeks ago

Describe the bug

When updating a Camunda 7 element template to a new version previous properties are overridden even if the property hasn't changed in the element template and the property was changed. We fixed this for Camunda 8 element tempaltes a while ago (cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/661).

Steps to reproduce

  1. Create and apply a template with the following property
{
  "binding": {
    "type": "camunda:outputParameter",
    "source": "foo"
  }
}
  1. Change the property

Camunda_Modeler_AVWTta6wOc

  1. Create and apply a new version of the template without chaning the property

Camunda_Modeler_HY7Twj5Bay

  1. Property overridden

Expected behavior

Property not overridden

Environment

Additional context

Support case: https://jira.camunda.com/browse/SUPPORT-24406?atlLinkOrigin=c2xhY2staW50ZWdyYXRpb258aXNzdWU%3D Incident: https://app.incident.io/camunda/incidents/1981

jarekdanielak commented 1 week ago

Moving it to backlog, as this is related to a minimal impact Camunda 7 support case.

Luca1206 commented 1 week ago

Another hint / thing that confuses me with Output-Properties in Element-Templates (I also mentioned it in the camunda support ticket):

The option to disable outputs only appears, when you omit the type from the property. You cant disable outputs when you set a type. If you just leave an output-property empty, the engine will complain about a missing field when you deploy the bpmn (since the process variable name isn't set).

So output fields are always implicitly required. In this case, wouldn't it be better to only set data in the XML, when someone actually enters a process variable name into the field? When I want to make a required output, i would have added a required constraint to the template.

It would be great to have some way of disabling outputs by default in element templates (or have non-required fields behave like mentioned above) - at the moment you have to disable the toggle on each variable which is annoying when applying new templates with many outputs.

nikku commented 1 week ago

@Luca1206 I agree that there may be potential to improve outputs, but let's please discuss that in a separate topic if we want to drive things forward. As a matter of fact we're likely not going to revise output mappings + element templates in Camunda 7, but for the better of our users this may be valid input for Camunda 8, too.

Luca1206 commented 1 week ago

@nikku no problem, I understand that you want to keep it separated and i fully agree that its better that way. Ill open a seperate support ticket for that, so that we keep it in mind and can discuss it seperately.

nikku commented 1 week ago

@Luca1206 You can also just create an issue in this repository.

Luca1206 commented 1 week ago

@nikku Since this is my private GitHub account and i don't have a company one, I opened a support-ticket where I suggested the improvements to output mappings in templates: SUPPORT-24566