Book a Demo

Author Topic: Hide connectors with specific stereotypes in certain diagram types by default  (Read 4523 times)

McMannus

  • EA User
  • **
  • Posts: 108
  • Karma: +4/-1
    • View Profile
Hi guys,

I have defined several relation stereotypes in our profiles that serve for traceability and containment. The containment relations aim at specifying a containment structure being independent from the implicit containment existent through the project browser. The driver for this decision was EA's automatic model movement of elements to other parents based on diagram movement.

When elements are created from the toolbox or programmatically, the relations are automatically created. As we know, a connector is shown by default, if both source and target element appear together in a diagram. This clutters diagrams a lot for my specific use case, therefore I'd like to hide these connectors by default. My approach for doing so was to hide the diagram links in code directly after I put the elements and the connector in the diagram programmatically.

The problem is that the hiding doesn't have any effect, because the diagram link is apparently not created immediately, when the elements (connected already in the model) are put in the diagram.

I wonder if it's possible to hide certain stereotyped connectors through the profile definition directly.

I didn't find anything in the docs w.r.t such a feature. If this is not possible, I have to solve that programmatically somehow.

In this case: Did someone face a similar issue in the past that diagram links only appear delayed in t_diagramlinks and probably has a solution for this issue?

Another option, we used for similar things in the past was to use refGUID tagged values referencing the related elements. However, I remember, they had to be maintained manually (i.e. potential inconsistencies because of deletions of referenced elements) and therefore we discarded this approach back then.

Thanks for your help, guys :-)

Jan
« Last Edit: February 26, 2017, 12:06:40 am by McMannus »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
AFAIK there's nothing to hide stereotyped connectors. You can either write a script to hide your connectors on request. Or you subscribe to the post new diagram object event. Once the new diagram object is created, it should be possible to suppress the connector. I haven't tried that.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Hi Jan,

diagramlinks are only created when there is a change to the default settings for a link.  Otherwise, the defaults are used.  However, hiding a connector is such a change from the default.

Perhaps you need to make sure all your collections and diagrams are saved/refreshed.  We create Neighborhood diagrams where we automagically hide certain relationships.  We do have to make sure all the appropriate collections are in a suitable state.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!