Author Topic: How do I customize the Relationships filter?  (Read 796 times)

John Lynn

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
How do I customize the Relationships filter?
« on: August 30, 2018, 01:59:40 am »
Suppose I have a SPARX model with objects A, B, C, and D which are associated as follows: A->B->C. (D is not associated with anything).

My goal is to have a diagram containing A, C, and D where selecting A will highlight C, but not D.

Using the Relationships filter (Layout > Filter > Relationships) in SPARX 14 I can achieve this effect if I associate A directly to C and then hide the relationship. The problem is that I'm going to have a model with tens or hundreds of objects, and this method won't scale very well.

Is there a way in SPARX to create a custom Relationships filter that goes multiple levels? Is there a way to restrict which relationships it utilizes based on stereotypes or tagged values?

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +7/-3
  • Am I supposed to say something here ... ?
    • View Profile
Re: How do I customize the Relationships filter?
« Reply #1 on: August 30, 2018, 08:43:28 am »
If you have A and C on the diagram but not B then as far as Sparx is concerned there is no relationship there. Sparx has no capability for inferring or acting upon derived relationships such as that (i.e. A->B->C therefore A->C)

As far as I can see, you have two options:
1) Explicitly add in the derived relationships, ie. A->C
2) Do some voodoo with scripts.  You can certainly use this approach to generate queries, however for anything interactive on diagrams this approach will also likely come to down to creating those derived relationships

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6867
  • Karma: +147/-104
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How do I customize the Relationships filter?
« Reply #2 on: August 30, 2018, 10:22:15 am »
Hi John,

As Matthew said, you will have to create the derived relationships.  There are a number of problems.  EA doesn't natively support derivation for all relationship types. It also doesn't have a standardised way of rendering derivation.  You need to be able to distinguish derived from canonical relationships otherwise your model gets confusing very quickly.

Because we completely control our repositories with our own MDG, we have (through shapescripts) implemented derivation across all relationship types and a standardised rendering of the derived relationship so that they are less prominent than canonical relationships.  We have also implemented the derivation type: by traversal, by union, by specialization etc.  By implementing an explicit derivation relationship (from the derived relationship to the items that it is derived from) we can define exactly how the derivation is accomplished).

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

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +7/-3
  • Am I supposed to say something here ... ?
    • View Profile
Re: How do I customize the Relationships filter?
« Reply #3 on: August 30, 2018, 01:28:10 pm »
Paolo

That sounds ... quite amazing !

... we have (through shapescripts) implemented derivation across all relationship types and a standardised rendering of the derived relationship so that they are less prominent than canonical relationships.  We have also implemented the derivation type: by traversal, by union, by specialization etc.  By implementing an explicit derivation relationship (from the derived relationship to the items that it is derived from) we can define exactly how the derivation is accomplished).

I can see how shapescripts could be used to visually differentiate derived relationships (nice), but I'd love to understand more about how you are establishing and using those derived relationships.
Is this automatic or manual?
How is the derivation type set and used?
Are you controlling whether derived relationships appear (e.g. in John's case, show the derived relationship A->C iff B is not on the diagram)?
Are you able to share some views of how you're using the derivation?

Thx
Matt

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9537
  • Karma: +274/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How do I customize the Relationships filter?
« Reply #4 on: August 30, 2018, 02:51:39 pm »
We use exports to excel to get overviews of multi-level relationships.

In those excels we export a specific set of related elements we are interested in

e.g.
- Actor x Use Case x User Interface
- XSD x Message x Functional Information Stream

The advantage of exporting this type of information to excel is that this information can be used by less technical users as they generally know how to use excel better then how to use EA.

Most of these excel files are being created by exporting an SQL search result to excel, but some of the more complex ones are created by a script.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6867
  • Karma: +147/-104
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How do I customize the Relationships filter?
« Reply #5 on: August 30, 2018, 05:14:03 pm »
Paolo

That sounds ... quite amazing !

... we have (through shapescripts) implemented derivation across all relationship types and a standardised rendering of the derived relationship so that they are less prominent than canonical relationships.  We have also implemented the derivation type: by traversal, by union, by specialization etc.  By implementing an explicit derivation relationship (from the derived relationship to the items that it is derived from) we can define exactly how the derivation is accomplished).

I can see how shapescripts could be used to visually differentiate derived relationships (nice), but I'd love to understand more about how you are establishing and using those derived relationships.
Is this automatic or manual?
Quote
Mainly manual, but some are created automatically (by back-end queries - typically during our nightly processing)
We denote the derivation by an IsDerived tagged value.  This triggers the rendering of a blue "solidus" near the origin of the arc and the rendering of the arc in a light grey.  We also provide a mechanism to surface the notional arc colour into parts of the arc.  (For example, suppose we use Orange to indicate something must change (as opposed to being created or deleted in a transition diagram)  You set the arc colour to Orange and you'll end up with a light grey line with orange highlights.)
How is the derivation type set and used?
Quote
Again, it is principally set manually.  One or more tagged values are added  IsTraversal, IsUnion, IsSpecialization, IsProjection to denote the specific type(s) of derivation involved. These tagged values render as a single letter on the line next to the solidus.  More than one such tagged value is allowed.
Are you controlling whether derived relationships appear (e.g. in John's case, show the derived relationship A->C iff B is not on the diagram)?
Quote
Well, because it's a real relationship if you drag A and C onto the same diagram, the derived A->C relationship will appear.  You can then decide to leave it on the diagram or not.  We will shortly be implementing a widget for our diagrams that will indicate whether there are hidden relationships on the diagram.  (It would be GREAT if Sparx implemented such an indicator - but in the interim...)
Are you able to share some views of how you're using the derivation?
Quote
(Can't get forum to display imgur link, but see: https://imgur.com/RAoLPzM)

Thx
Matt
« Last Edit: August 31, 2018, 04:39:21 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 10624
  • Karma: +233/-194
  • I'm no guru at all
    • View Profile
Re: How do I customize the Relationships filter?
« Reply #6 on: August 31, 2018, 05:56:42 pm »
Something in your quoted quotes makes me think you invent citations.

q.