pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

BPMN2.0 (xml): Is attribute "name" mandatory to have in Gateway-Elements? #196

Closed solterbeck closed 3 years ago

solterbeck commented 3 years ago

Dear PM4PY guys,

just a question. I haven't found even on omg.org any hint, that says, that attribute is mandatory in Gateway-Elements like, "bpmn:exclusiveGateway".

I did create some bpmn graphs with bpmn.io, Camunda Modeler and Enterprise Architect by Sparx. I set no name for the gateways and all tools are telling me, that my model is BPMN 2.0 conform.

...
<bpmn:exclusiveGateway id="Gateway_0da3bf0">
   <bpmn:incoming>Flow_1nz7lbl</bpmn:incoming>
   <bpmn:incoming>Flow_09vnnd1</bpmn:incoming>
   <bpmn:outgoing>Flow_0xa3kwo</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_1nz7lbl" sourceRef="Activity_1idyydt" targetRef="Gateway_0da3bf0" />
<bpmn:sequenceFlow id="Flow_09vnnd1" sourceRef="Activity_0z63frv" targetRef="Gateway_0da3bf0" />
<bpmn:task id="Activity_0ej9r5c" name="Activity C">
       <bpmn:incoming>Flow_0xa3kwo</bpmn:incoming>
       <bpmn:outgoing>Flow_0fbmlvx</bpmn:outgoing>
</bpmn:task>
...

Trying to import such a graph with pm4py.read_bpmn() I will get runtime errors like

... 
bpmn_graph = parse_element(bpmn_graph, counts, child, list(parents) + [child], incoming_dict, outgoing_dict,
  File "C:\ProgramData\Miniconda3\envs\my-prom-env\lib\site-packages\pm4py\objects\bpmn\importer\variants\lxml.py", line 31, in parse_element
    name = curr_el.get("name").replace("\r", " ").replace("\n", " ")
...

As far as I add manually the attribute (name="") in XML then import is ok, as well when I give the gateway in graph any name.

Is the attribute name - in the meaning of the official specs - mandatory or not?

Thanks and best regards Sven

fit-alessandro-berti commented 3 years ago

Dear solterbeck,

You are right. The name element is not required for some element

We will release a fix for the signaled issue in the next release of PM4Py

Thanks for signaling!

fit-alessandro-berti commented 3 years ago

Resolved in release 2.1.4