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

Missing label validation for gateway #94

Closed
danielriedmueller opened this issue Feb 26, 2025 · 4 comments
Closed

Missing label validation for gateway #94

danielriedmueller opened this issue Feb 26, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@danielriedmueller
Copy link

danielriedmueller commented Feb 26, 2025

Describe the Bug

If a gateway has two inputs and one output and no label,
it shows no error.

Expected Behavior

All gateways must have a label, regardless of connections.
Its expected that the linter shows an error.

Image

BMPN to reproduce:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:process id="Process_1" isExecutable="false">
    <bpmn:startEvent id="StartEvent_1" name="a">
      <bpmn:outgoing>Flow_00fqd4a</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:exclusiveGateway id="Gateway_07ubf6j">
      <bpmn:incoming>Flow_0o5mpbt</bpmn:incoming>
      <bpmn:incoming>Flow_15iaxbt</bpmn:incoming>
      <bpmn:outgoing>Flow_19faper</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:endEvent id="Event_1qe3417" name="c">
      <bpmn:incoming>Flow_19faper</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_00fqd4a" sourceRef="StartEvent_1" targetRef="Gateway_0oz6smg"/>
    <bpmn:sequenceFlow id="Flow_19faper" sourceRef="Gateway_07ubf6j" targetRef="Event_1qe3417"/>
    <bpmn:exclusiveGateway id="Gateway_0oz6smg" name="gateway label">
      <bpmn:incoming>Flow_00fqd4a</bpmn:incoming>
      <bpmn:outgoing>Flow_0o5mpbt</bpmn:outgoing>
      <bpmn:outgoing>Flow_1ubb3cz</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sequenceFlow id="Flow_0o5mpbt" sourceRef="Gateway_0oz6smg" targetRef="Gateway_07ubf6j"/>
    <bpmn:task id="Activity_14jxjwd" name="b">
      <bpmn:incoming>Flow_1ubb3cz</bpmn:incoming>
      <bpmn:outgoing>Flow_15iaxbt</bpmn:outgoing>
    </bpmn:task>
    <bpmn:sequenceFlow id="Flow_1ubb3cz" sourceRef="Gateway_0oz6smg" targetRef="Activity_14jxjwd"/>
    <bpmn:sequenceFlow id="Flow_15iaxbt" sourceRef="Activity_14jxjwd" targetRef="Gateway_07ubf6j"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="173" y="92" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="188" y="135" width="7" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_0oz6smg_di" bpmnElement="Gateway_0oz6smg" isMarkerVisible="true">
        <dc:Bounds x="255" y="85" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="246" y="55" width="68" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_07ubf6j_di" bpmnElement="Gateway_07ubf6j" isMarkerVisible="true">
        <dc:Bounds x="345" y="85" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1qe3417_di" bpmnElement="Event_1qe3417">
        <dc:Bounds x="432" y="92" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="447" y="135" width="6" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_14jxjwd_di" bpmnElement="Activity_14jxjwd">
        <dc:Bounds x="230" y="210" width="100" height="80"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_00fqd4a_di" bpmnElement="Flow_00fqd4a">
        <di:waypoint x="209" y="110"/>
        <di:waypoint x="255" y="110"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_19faper_di" bpmnElement="Flow_19faper">
        <di:waypoint x="395" y="110"/>
        <di:waypoint x="432" y="110"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0o5mpbt_di" bpmnElement="Flow_0o5mpbt">
        <di:waypoint x="305" y="110"/>
        <di:waypoint x="345" y="110"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1ubb3cz_di" bpmnElement="Flow_1ubb3cz">
        <di:waypoint x="280" y="135"/>
        <di:waypoint x="280" y="210"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_15iaxbt_di" bpmnElement="Flow_15iaxbt">
        <di:waypoint x="330" y="250"/>
        <di:waypoint x="370" y="250"/>
        <di:waypoint x="370" y="135"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
@danielriedmueller danielriedmueller added the bug Something isn't working label Feb 26, 2025
@nikku
Copy link
Member

nikku commented Feb 26, 2025

@danielriedmueller Why would a joining gateway need a label? What would be the user problem this solves?

@nikku nikku added the needs more information Requires additional information to be actionable. label Feb 26, 2025
@nikku
Copy link
Member

nikku commented Feb 26, 2025

Closing this as not planned, but happy to hear your thoughts to learn.

@nikku nikku closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
@danielriedmueller
Copy link
Author

Thanks for your response, that makes sense.
However in our project, we need to have each elements have labels and these labels need to be unique.
I made a proposal for a rule for unique labels: bpmn-io/bpmnlint#153.
We would have preferred to use a official rule from your side, but i guess we can implement our own rules as well.

@nikku
Copy link
Member

nikku commented Feb 27, 2025

We've seen and discussed bpmn-io/bpmnlint#153. As we evolve our rule set and do more "at the core" we have to ensure to provide value to many. Your scenario "all elements have to be named" seems to be special. And completely (everywhere) enforcing unique labels does not make sense from the pure BPMN standpoint, too.

What bpmnlint offers is the ability to configure rules. So we could build (or you could contribute) changes that are configurable, but work per default in a reasonable (for many) way.

@nikku nikku removed the needs more information Requires additional information to be actionable. label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants