Book a Demo

Author Topic: Hiding flow connectors trouble  (Read 7810 times)

pepices

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hiding flow connectors trouble
« on: February 04, 2024, 01:41:49 am »
Hi! I'm working modeling integration flows between systems (Application components) at business level (Archimate business objects linked to the flow) and technical level (Archimate Data objects and transport technology linked to the flow). We're 2 people working making two models (biz+tech) but our modeled flows appear both models. We know hiding option for a flow can hide it on other diagrams, but we're talking about hundreds of them sometimes replicated several times by EA when linking them several shared Business/Data objetcs. Is there any way to force a flow doesn't appear any other model than the one it was created for? Any other way hiding flows one by one is an stupid iterative work.

Thank you so much. Note we're not so expert in the tool yet.

Best,

Juan

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Hiding flow connectors trouble
« Reply #1 on: February 04, 2024, 03:31:31 am »
No, you can't.

But you should think about why this is a problem for you. If there is a relation between 2 elements, and you put those two elements on a diagram, I would expect you want to see all relations between those two elements.

The fact that you have relations that should only appear on one diagram, indicates you might be doing something wrong in terms of modelling.

What you can do is write a little script to hide specific type of relations from specific type of diagrams.

Geert

pepices

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Hiding flow connectors trouble
« Reply #2 on: February 04, 2024, 11:17:58 pm »
Hello Geert. First of all, many many thanks for your help and support, it's not so easy for me to find it. In the other hand, I'll try to explain what I've been told to do:
Two systems, a business model sharing a business object such as an invoice (system A sends the invoice to system B by using a flow and linking this object to the flow)
Technology model is trying to represent same flow, but business object invoice is made up by two different data objects (structured data && digital invioce -pdf as an example-). Two data objects are sent from system A to system B. I don't want to mix both models since the technical view is more complex (extra info such as deployments or communication middleware -ESB-)

I think this is a good modeling approach, but maybe i'm wrong:

1.- Could I get a good modeling sample of my use case or similar to know how to model it the right way?
2.- If manual hidding or 'freeze visible' option could fit my need, I'll apply but thousands of flows will need to be manually hidden :-(
3.- If a script could be made it would be great, but I'm not familiar with EA scripting, could you provide an example please? (As an example, a function/rpocedure that hides all data -or business- objects found in a model)

Thank you so much for your help Geert.

Juan

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Hiding flow connectors trouble
« Reply #3 on: February 05, 2024, 05:51:44 pm »

pepices

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Hiding flow connectors trouble
« Reply #4 on: March 20, 2024, 09:24:24 pm »
Hell again, Geert, sorry for disturbing you one more time. Unfortunately, I couldn't find any code snippet in your repo that could fit for my purpose, and I finally tried with chatGPT. I can go through an EA objects collection for finding the connector I want to hide, I locate it but I'm not able to finally hide it. I paste a partial code snippet for you to tell me (if you can) what I'm doing bad. I'm almost craisy :-)

                // Iterate through connectors of the element
                for (var j = 0; j < element.Connectors.Count; j++) {
                    var connector as EA.Connector;
                    connector = element.Connectors.GetAt(j);
               var nombre=connector.Name.toLowerCase();
               var index=nombre.indexOf("data transport solution");
               if(index !== -1) {
                  connector.IsHidden = true;
                  connector.Update();
               }
                }
Seems that IsHidden method doesn't exist and I don't know how to progress.

Thousand thanks, Geert, for your help.

Juan

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Hiding flow connectors trouble
« Reply #5 on: March 20, 2024, 09:30:25 pm »
Don't bother with ChatGPT, that is only useful if you already know how to write the code. If not you'll wast more time figuring out why methods that ChatGPT hallucinated don't work.

The "ishidden" property is found on the DiagramLink, not on the connector itself.
The diagramLink is the representation of the connector on a specific diagram.

Here's an example script that hides certain connectors: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20A/Old%20Scripts/FixDiagram.vbs

Geert

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: Hiding flow connectors trouble
« Reply #6 on: March 21, 2024, 10:25:01 am »
This is not related to the main topic, but I would like to give an example where we want to hide connectors in other diagrams.

In the UAF (Unified Architecture Framework) there are often the same elements in 2 or more diagrams. For example, St-Tx and St-Sr have the same elements, but we show 'is-a' relationships in St-Tx and we show 'has-a' relationships in St-Sr.

So in Enterprise Architect we show only Generalisations in the St-Tx and only Aggregations in the St-Sr and we hide other types of connectors. In this case, the Freeze Visible feature in Enterprise Architect is necessary. (Please see the example model in the UAF specification.)

I mean, it might not be wrong if we want to hide some connectors in some diagrams. It depends on what we want to show in each view (diagram).

HTH,
--
t-kouno