Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow multiple messages with the same name #4339

Open
strangelookingnerd opened this issue Jun 6, 2024 · 4 comments
Open

Do not allow multiple messages with the same name #4339

strangelookingnerd opened this issue Jun 6, 2024 · 4 comments
Labels
backlog Queued in backlog enhancement New feature or request linting ux

Comments

@strangelookingnerd
Copy link
Contributor

strangelookingnerd commented Jun 6, 2024

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

  • Version: 5.23.0
  • Operating System: Windows 10 amd64
  • Plugins:
  • Execution Platform: BPMN - Camunda 7

Additional context

Related to #4341, #4343, #4344

@nikku
Copy link
Member

nikku commented Jun 6, 2024

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.

@nikku nikku added enhancement New feature or request ux linting and removed bug Something isn't working labels Jun 6, 2024
@strangelookingnerd
Copy link
Contributor Author

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
Copy link
Member

nikku commented Jun 7, 2024

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

@nikku nikku added the backlog Queued in backlog label Jun 7, 2024 — with bpmn-io-tasks
nikku pushed a commit to bpmn-io/bpmnlint that referenced this issue Jun 20, 2024
A rule that verifies that global elements are properly used.

Currently recognized global elements are:

  * `bpmn:Error`
  * `bpmn:Escalation`
  * `bpmn:Signal`
  * `bpmn:Message`

For each of these elements proper usage implies:

  * element must have a name
  * element is used (referenced) from event definitions
  * there exists only a single element per type with a given name

Related to camunda/camunda-modeler#4339
@nikku
Copy link
Member

nikku commented Jun 20, 2024

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 (jonathanlukas/camunda-modeler-linter-default-rules#45).

Thanks @strangelookingnerd!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog enhancement New feature or request linting ux
Projects
None yet
Development

No branches or pull requests

2 participants