camunda / camunda-modeler

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

Do not allow multiple messages with the same name #4339

Open strangelookingnerd opened 3 weeks ago

strangelookingnerd commented 3 weeks ago

Describe the bug

Currently it is possible to create multiple bpmn:message (as well as escalation, errors...) with identical names but different IDs. In the UI you can only select these message by the "global message reference" which is based on the name. For the user there is no way to distinguish them. Since I can not imagine any scenario where a user would want / need multiple messsage of the same name to be in place I'd argue that it should not be possible to create messages with identical names.

Steps to reproduce

  1. Create a new message event with name MyMessage grafik
  2. Create another message event with the same name grafik
  3. End up with two messages with the same name grafik

Expected behavior

It should not be possible to create multiple messages with identical names.

Environment

Camunda Modeler system information

Additional context

Related to #4341, #4343, #4344

nikku commented 3 weeks ago

This should be addressed via a lint rule. There is no good reason to have multiple messages with the same name. On the other hand, does it hurt?

We go by the principle of "being forgiven", but also helpful. Hence our strategy is not to prevent you from duplicating, rather we allow you to fix the issue.

strangelookingnerd commented 3 weeks ago

This should be addressed via a lint rule. There is no good reason to have multiple messages with the same name. On the other hand, does it hurt?

We go by the principle of "being forgiven", but also helpful. Hence our strategy is not to prevent you from duplicating, rather we allow you to fix the issue.

It surely does not hurt but chances are very high it was not intended by the user and thus should be warned about. Adding a lint rule sounds like a reasonable solution.

nikku commented 3 weeks ago

@strangelookingnerd Happy to take a contribution that validates this in bpmnlint.

nikku commented 1 week ago

This is now available and validated as a bpmnlint rule, and can be plugged-in to the modeler via the camunda-modeler-default-linter-rules plugin soonish (https://github.com/jonathanlukas/camunda-modeler-linter-default-rules/pull/45).

Thanks @strangelookingnerd!