Book a Demo

Author Topic: Adjust display of component on diagram based on relationship  (Read 9840 times)

Michael Mangelschots

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Adjust display of component on diagram based on relationship
« on: November 07, 2016, 07:36:01 pm »
Hello,

I'm creating an overview of the different applications that exist in my company. My company also is active in several sectors. An application is not always used for every sector my company is active in.
In the diagram that I'm creating I would like it to be visible for which sector the application is used.

The applications are created as components and the sectors as activities. For the relationship I used the "Used By" relationship from ArchiMate.

The result is:


Now I would like it to be visible, without the arrows to be visible, for which sector the application is used, for example:


Is there any way to do this in EA, without having to manually draw the rectangles on each application?
Any help would be appreciated.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #1 on: November 07, 2016, 10:17:04 pm »
You need to write some shape scripts for this (should not be too difficult). You can control the colors with appropriate tagged values. Consider creating an MDG for this purpose.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #2 on: November 07, 2016, 10:37:27 pm »
Hello Michael,


And welcome to the forum. I'll say the same thing as qwerty, just using more words. :)

An MDG Technology is EA's deployment format (basically an XML file) for adaptations.

An MDG Technology contains profiles, profiles contain stereotypes. An EA stereotype may define a shape script, which determines how the element or connector is drawn.

In your case, you would need one element stereotype for your components, and one connector stereotype for your connectors.

You have a problem in that element shape scripts can't check any properties of other elements than the one being drawn, which you'd need to do in this case to determine what activities each component is connected to. However, if all else fails a shape script can call an Add-In (which you would then have to write), which can pull any information out of the database.

What qwerty is suggesting with the tagged values is a different way of expressing the relationship: use tagged values (of the RefGuidList type) instead of the connectors to represent the active sectors. An advantage with this approach is that no connectors are drawn, so they don't need to be hidden. A disadvantage is that since there's no connector, finding all applications for a certain sector becomes difficult.

If that's not a concern, the tagged values approach is definitely the way I would go. And if it's a concern but a minor one, you can always create a custom repository search query.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Michael Mangelschots

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #3 on: November 07, 2016, 10:50:31 pm »
Thanks a lot Qwerty & Uffe. I haven't used MDG yet, but this seems like a good opportunity to learn.

Tx!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #4 on: November 08, 2016, 09:23:42 am »
If you're not committed to the colored boxes, I would consider using a relationship compartment to display the relationships on the element textually.

See http://sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/add_custom_compartments_to_ele.html
« Last Edit: November 08, 2016, 09:33:59 am by Simon M »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #5 on: November 08, 2016, 07:54:12 pm »
Ah - sorry, yes. RelatedElement sub-shapes allow you to check properties of connected elements. But not to the point where you can draw boxes in the main shape based on them.

/U
My theories are always correct, just apply them to the right reality.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #6 on: November 09, 2016, 08:11:18 am »
Ah - sorry, yes. RelatedElement sub-shapes allow you to check properties of connected elements. But not to the point where you can draw boxes in the main shape based on them.

/U
Exactly, I don't think your response was wrong. I just provided an alternate solution if text was acceptable. The third option is an add-in call within the shape script, but I'd avoid that if possible because it's tricky to do with acceptable performance.

Michael Mangelschots

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #7 on: November 09, 2016, 05:58:25 pm »
I've managed to make the necessary changes with shape scripts (powerfull feature I didn't know about!) and with an addin to check the information. But the performance is horrible (we have a lot of applications ;) ). I'm considering moving the connector information to a tag or at least make a plugin to fill in tag information from the connector information periodically on-demand.
You guys have been a great help so far.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #8 on: November 10, 2016, 08:28:51 am »
The performance problem that you're seeing is that the shape script add-in call is being done for every draw. That would mean that for every draw you are currently loading the full object from the guid passed in (8 or so sql calls) loading the connectors collection (another sql call) and for every connector, loading the other end of the connector (another 8 or so sql calls each). When scrolling around the diagram, all of that takes much too long for the normally smooth scrolling to work.

To achieve reasonable performance on that, you will need to cache the results you are after (on first request or diagram load) and then invalidate your cache for the objects involved with a connector add, modify or delete.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #9 on: November 10, 2016, 12:03:06 pm »
If you're not committed to the colored boxes, I would consider using a relationship compartment to display the relationships on the element textually.

See http://sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/add_custom_compartments_to_ele.html
But aren't compartments available ONLY in some display modes (e.g. Rectangular/Non-rectangular notation)  (as per Help?)

I've previously had a look at same and rejected for that reason (only available in Rectangular mode).

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #10 on: November 10, 2016, 05:41:47 pm »
The above shapes look rather rectangular.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #11 on: November 10, 2016, 06:10:23 pm »
The above shapes look rather rectangular.

q.
They look rectangular, but they may not be in Rectangular (Compartmentalised)  Notation.

In our MDG, when you switch to Rectangular Notation, there's a specific widget to tell you so you KNOW if you're in Rectangular Notation.

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Adjust display of component on diagram based on relationship
« Reply #12 on: November 11, 2016, 08:41:50 am »
The components (which are showing the boxes) will display compartments.

The activities won't unless you enable rectangle notation.