Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: patrick j. on November 20, 2020, 02:22:05 am

Title: Linking from structures to type block diagrams
Post by: patrick j. on November 20, 2020, 02:22:05 am
Hello!

I have in DDS modelling a IDL::IDLStruct with two Attributes, one a key (name="head", type="Header") and some idlField. When it comes to the key, I have some block diagram, defining the actual "Header" type, including some internal block diagram.

What is a good way of linking an attribute of some structure with a well defined type to the corresponding block diagram of this type? When changing properties within the type, these modifications are properly forwarded to the attribute, but the other way round is difficult, find the type definition diagram from the attribute itself.

Best regards!
Title: Re: Linking from structures to type block diagrams
Post by: Uffe on November 20, 2020, 08:45:33 pm
Hi Patrick,


Wow, DDS eh? That takes me back. Glad to see someone's using it. :)

Unfortunately, what you want doesn't really have any support in EA.

... linking an attribute of some structure with a well defined type to the corresponding block diagram of this type?
The problem is that EA is not aware of any one single diagram associated with any element. While you can locate the classifier element which is used as the attribute's type, EA doesn't have a concept of a particular diagram which defines that type.

So it's not something that exists in vanilla EA, but it is quite possible to achieve something like it.
Here's an outline of a solution:
As an alternative to creating a tagged value, you could conceivably use composite diagrams. Each element in EA can have one (1) composite diagram, and that diagram has some special handling associated with it so it's easy to retrieve from the API and so on. However, this assumes that no type-definition diagram defines more than one type, because two elements can't share the same composite diagram.
(Well, technically they can, but it's not intended use and it can have nasty side effects -- deleting an element also deletes its composite diagram, and if that diagram happens to be the composite diagram of another element then that other element loses its composite diagram. This is probably not what you want, so it's better to go with a tagged value even if you do have to copy-paste a lot of GUIDs.)

The Add-In could also include some support functions to reduce the amount of GUID copy-pasting, clear the tagged values targetting a certain diagram when that diagram is deleted (or indeed prevent the deletion of said diagram if it's the target of an element's tagged value), etc.

You could also just locate the type element, rather than the type-definition diagram, and then use EA's built-in "Find in Diagrams" function. This would obviate the need for tagged values storing the type-definition diagram GUIDs.
However, you'd still need the Add-In because the crux is once again that only an Add-In can be aware of what attribute the user has selected in a diagram. Also, if the element is present in more than one diagram, the user would be presented with a selection dialog and then need to select the correct one.
So that would be a simpler solution that does not introduce any tagged values (which need maintenance as the model changes over time), but at the cost of a less smooth user experience.

HTH,


/Uffe

PS Why yes, I am available to build this for you. ;) Hit me up with a PM if you'd like a quote.
Title: Re: Linking from structures to type block diagrams
Post by: patrick j. on November 24, 2020, 02:16:28 am
Hi Uffe!

Thank you very much for your detailed answer! While an add-in definitely seems like an ideal approach to make this feature work in a proper way, your second idea regarding the composite diagram looks charming to me, as well... I am just trying to use the composite approach, and so far I am pretty happy. Let's see, if this approach can scale properly and my colleagues understand what I am trying here ;-)

Best regards,
Patrick