Author Topic: Compartments and instances  (Read 683 times)

Mats Gejnevall

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Compartments and instances
« on: December 14, 2017, 03:13:52 am »
Hi all
I am using compartments a lot to show relationships. But when I have relations between an element and an instance of an element I have a problem. But just in one direction. Element to instance works fine with some shape scripting, but when I want to see the relations of the element that has relations to the instances of it in the compartment of that element, it does not work.

Example: I have more than one firewall in my diagram. I create instances of that firewall and connect these instances to networks. When I use compartments to show which firewalls these networks are using it works fine, but when I want to see what networks the firewall element is connected to I get no information. I assume it is because the instance and element are different database entries.

Any solutions?



  • EA Practitioner
  • ***
  • Posts: 1274
  • Karma: +93/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Compartments and instances
« Reply #1 on: December 15, 2017, 10:51:48 pm »
Hej Mats,

The only solution I can see is to create an Add-In and call that in your shape script.

The problem, as you've identified, is that the classifier and instances are different elements, and while there is a unique classifier for each instance, the reverse is not true. So a shape script can find the classifier of an element, but not its instanceS.

What would be useful to resolve this is to extend the custom compartment feature of the shape script, so that in addition to ChildElement and RelatedElement, you could add a sub-script for InstanceElement -- worth a feature request, I think.

But as it is, you can't retrieve the instances without going through an Add-In.

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