cancel
Showing results for 
Search instead for 
Did you mean: 

diagram unique Id generation issue

yangyang_qian
Champ in-the-making
Champ in-the-making
I had noticed that sometimes, when I've been working on multiple Activiti diagrams across multiple days, that the unique Ids generated for the workflow objects will overlap and repeat. The diagram compiles, but when I try to later run the process the engine complains that there are multiple workflow elements with the same id (i.e. two sequenceFlows both with id="flow12"). And if I inadvertently delete one of the repeated elements via right-click-delete or trash-ban, it screws up the diagram …

here might be a way to recreate the issue …

1) assume any id counter starting point, i.e. X = 0
2) create diagram D1,   start –> manual task 1 –> manual task 2 –> end   .  The unique id counter is at X + 3 (i.e. id="flow3"). Save the diagram. Close diagram.
3) create diagram D2, also same process      start –> manual task 1 –> manual task 2 –> end.  The unique id counter should be at X + 6 (i.e. id="flow6"). Save diagram. Close diagram.
4) reopen D1,   add a sequenceFlow from manual task 1 to end twice (delete one, then add it again).   The unique id counter should be at X + 8 (i.e. id="flow8"). Save diagram. Close diagram.
5) close and reopen eclipse

here is where I started getting some issues …

6) reopen D2,   add a sequenceFlow from manual task 1 to end. The unique id counter is at X + 7 … I guess because last time D2's max id was X + 6. Save and close D2.
7) reopen D1,    delete any  sequenceFlow and re-add it. The unique id counter is at X + 8 … I guess because it was just at X + 7?
😎 now, D1 has two instances of X + 8 (i.e. id="flow8") …


I've often juggled working on multiple processes at the same time … and it definitely takes me more than a single sitting to finish some processes. The result is that these duplications sometimes get so bad that I have to give up on fixing the xml and just start the diagram over from scratch …

I've noticed this issue since release 5.2 (I started in 5.0 but my processes weren't so complicated then and thus issue probably never had a chance to manifest) but I have no clue why it's happening …

Is this a bug in the designer plugin? Or my eclipse environment? Or just that my workstation hates me  :cry: ?


(currently running on Activiti Eclipse BPMN 2.0 Designer 5.4.0   on    Eclipse helios for JavaEE - 3.6.2 )


Thanks!
7 REPLIES 7

mlisiewicz
Champ in-the-making
Champ in-the-making

yangyang_qian
Champ in-the-making
Champ in-the-making
oy,  Smiley Happy  glad I'm not just going crazy. Currently my workaround is to be very very very careful to only edit the first activiti diagram that I open during any single Eclipse session; I try to avoid touching the other diagrams until I've closed and reopened eclipse.

trademak
Star Contributor
Star Contributor
Hi,

Thanks for reporting this bug.
There was something wrong with the caching solution for identifiers.
I've modified it and uploaded a new archived update site to http://www.activiti.org/designer/archived/activiti-designer-5.4.1.zip.
Let me know if this solves your problems.

Best regards,

yangyang_qian
Champ in-the-making
Champ in-the-making
Thanks for the help!

I reinstalled the Activiti Designer using the new 5.4.1 zip provided by the link mentioned in the previous post … but still got the same error. I noticed that the minor version # still seems to be 5.4.0 instead of 5.4.1 in the install dialog. Was the new zip supposed to hold a "5.4.0" designer?

Sorry about the delayed response, we only had a chance to try out the fix just now.  Smiley Surprisedops:


By the way, I don't know if this is a related issue … but when I reinstalled Designer and reopened one of the process diagrams we are currently working on as part of the test … found a similar issue when adding a new sequenceFlow … the ID stared at id="flow9", but our diagram's set of sequenceFlows has the ids in the following listing. I was expecting the new Id to be    diagramUniqueIDs.maxId + 1  ? Or maybe I just don't understand the algorithm for the unique id generation …  Smiley Sad

flow37
flow38
flow39
flow40
flow41

flow44

flow47
flow48
flow49

flow51

flow53
flow54
flow55
flow56
flow57
flow58
flow59
flow60
flow61
flow62
flow63
flow64
flow65
flow66
flow67
flow68
flow69

flow71
flow72
flow73
flow74
flow75

trademak
Star Contributor
Star Contributor
Hi,

Thanks for the detailed response. The version was still 5.4.0, because the 5.4.1. archived site was just a quick deployment.
You say the problem persists, but have you checked if there is a flow with flow9 already in the diagram.
Could you provide me with your diagram, because a new seuqence flow should the max id + 1.
Please attach the .activiti to your post in this forum.

Thanks,

yangyang_qian
Champ in-the-making
Champ in-the-making
Sorry, just to clarify, for the main test, I just followed the steps outlined in the first post and still got the same issue with the duplicate flow ids.

After I ran the tests and made the post, I restarted eclipse (still with the 5.4.1 plugin installed) and was planning on working my old process diagram, when I noticed that a new squenceFlow started at flow9. Flow9 is definitely not in the diagram, but I worry that (a) this is a symptom of the existing issue and (b) after a few dev cycles the id increments will start overlapping with the existing objects. I restored to a copy of eclipse from backup (the one with the 5.4.0 plugin) and the ids started at max + 1 again.

So I only noticed the flow9 issue after the main test, and therefore am not sure if it is a related symptom.




:lol: I can't seem to upload an .activiti file directly … I stashed it in the zip file

trademak
Star Contributor
Star Contributor
Hi,

I tested the case of adding a new sequence flow in your activiti diagram and my sequenceflow gets an id of flow76.
So that seems to be fine.
Could you make sure that you install the 5.4.1 archived site on a fresh Eclipse installation.
Then this should work. Let me know if you still run into issues.

Best regards,