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

A UUID is not a valid ID for a BPMN element #1

Open
diegonc opened this issue Aug 20, 2021 · 1 comment
Open

A UUID is not a valid ID for a BPMN element #1

diegonc opened this issue Aug 20, 2021 · 1 comment

Comments

@diegonc
Copy link

diegonc commented Aug 20, 2021

let xmlString = xml || DefaultEmptyXML(newId, newName, this.prefix);

When creating a new BPMN model the code above will use the model id (newId, a UUID) as the key parameter to the blank xml function. It in turns uses it as an id for the bpmn2:process element and its reference from BPMNPlane.

This results in a modeller that doesn't allow to drop elements to its canvas.

The patch below makes the modeller work again.

diff --git a/lemon-workflow-frontend/package/process-designer/plugins/defaultEmpty.js b/lemon-workflow-frontend/package/process-designer/plugins/defaultEmpty.js
index 21c6343..bf4c9b9 100644
--- a/lemon-workflow-frontend/package/process-designer/plugins/defaultEmpty.js
+++ b/lemon-workflow-frontend/package/process-designer/plugins/defaultEmpty.js
@@ -15,10 +15,10 @@ export default (key, name, type) => {
   xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
   id="diagram_${key}"
   targetNamespace="${TYPE_TARGET[type]}">
-  <bpmn2:process id="${key}" name="${name}" isExecutable="true">
+  <bpmn2:process id="process_${key}" name="${name}" isExecutable="true">
   </bpmn2:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
-    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process_${key}">
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>`;

But I don't know if UUID are used elsewhere.

Here is the relevant ticket in bpmn-io ( bpmn-io/moddle-xml#41 )

@lyuxiaobo
Copy link
Owner

@diegonc Since the notification email from GitHub is in my spam list, I did not receive the issue notification in time. I use UUID as the key of the process to keep it consistent with the id of the model, but this is just an idea of mine. This is currently a bug. You can completely customize the key and name in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants