Hi,
I've been working on a tool which will procedurally generate associations in bulk between previously existing blocks in an EA package. The idea is to be able to take a relationship matrix or a paired list of blocks to be associated and automatically generate all of the associations in bulk.
This works in four steps:
1. Export blocks using CSV export to get the GUIDs for the blocks
2. Create a list of associations to be created with the "source" and "destination" GUIDs identified from the list in (1).
3. Export the block package as an XMI file to get the code description for the blocks.
4. Generate and insert code segments into the XMI file as appropriate to assign associations to their relevant blocks.
In order for this to work, I need to generate GUIDs for the associations themselves. I've got something that does this and formats them correctly. Each association needs three GUIDs, which look like this:
EAID_80BFD153_894C_CC50_BF21_E7DC2309C80F
EAID_srcBFD153_894C_CC50_BF21_E7DC2309C80F
EAID_dstBFD153_894C_CC50_BF21_E7DC2309C80F
Each digit is generated randomly from the possible list of hexadecimal characters.
The code works, and I'm able to import the XMI file and get most of the associations to be created in the corresponding diagrams (where the blocks are placed). However, somewhere between 5 and 10% of the created associations randomly fail to be generated. Occasionally, previously existing associations in other packages in the same model are also deleted when new XMI files are imported. The problem is not that the same GUID is being used twice, either - the probability of a repeat randomly generated 32 digit hexadecimal string is exponentially low, and in actual testing, no repeats exist.
The only thing I can see that might be wrong is that some combinations of hexadecimal characters are reserved by EA and so GUIDs which randomly fall in these spans are ignored. Can anyone explain how EA creates its GUIDs and what restrictions there may be on acceptable ones?
Separately, can anyone explain in greater detail what the "strip GUIDs" function does in the XMI import? I haven't been using it because the idea is to update existing blocks with new associations, and I'm hoping to avoid repeating block elements, etc.
Finally, what's up with EA not including associations in the project browser? The associations obviously exist somewhere in the database, and it is possible to modify the properties of an association by clicking on it. Other software I have used in the past includes these as elements in the browser which makes them dramatically more useful as well as easier to edit. Geert, does your EA Navigator tool enable this functionality? (Thanks, by the way, for the Excel Importer tool - it makes life sooo much easier)!