Author Topic: List Elements Tagged with a Value - Link through to their composite diagram  (Read 6113 times)

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile

THE CHALLENGE
I'd like to list out all elements that have a particular tagged value. 

If the element has a composite diagram, then I'd like to be able to click on the elemtn and be taken to the composite diagram.

As more elements are tagged with the particular value, I'd like the displayed list to dynamically update.

THE REASON
Historically I've done this manually by dragging elements onto my diagram - which results in them being clickable (with th elink symbol).  As time has gone on, this has become a maintenance issue

WHAT I'VE TRIED

I've tried a package as list - but modified the SQL to be as below.  But the elements aren't clickable

Code: [Select]
select o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name, o.Scope, o.Status, o.Author, o.Stereotype, op.value AS 'PMO Strategy'
from t_object o
left join t_objectproperties op on op.Object_ID = o.Object_ID
and op.value = 'Customer'
order by o.name

I've looked into documentation and list views etc but none seem to do what I need.


Does anyone have any suggestions for how this could be done?


TIA



Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
You can use a search, or even a model view element. They don't meet your exact criteria because I don't think they will automatically open the composite diagram. (But I could be wrong)

On a diagram, if you open the kanban settings you get the option to fill the diagram from a search or sql. That should give you your dynamically updated list and still give the composite diagram behavior.

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Thanks for you quick reply!

I've tried including the list in a model view element - but the listed items aren't clickable at all (not to their properties OR to their composite diagram)

I've tried using search but get the same result.

I liked your suggestion about using a kanban, which I haven't used in Sparx before, so thought I'd give that a go.  Having played with it a bit now, it does get the closest to what I'd like but the behaviour is a bit weird.  I guess I'm using it for something that wasn't intended...

For example:
  • If new items are tagged with the value I'm interested in, they are not added to the list (as they would be in a model view element).  I have to delete all the elements and re-run the search query
  • If an item is untagged with the value I'm interested in, they are removed from the kanban lane but not the diagram as a whole, they are just put on the right hand side (even though they no longer meet the criteria specified in my SQL query)
  • All items are displayed differently to normal. This shouldn't matter, except the link icons are no longer shown on the elements with composites, so the user cannot tell which elements are clickable and which aren't. Weirdly, they're displayed normally once untagged and positioned outside the lanes.  I can switch off 'kanban drawing style', but the link icon still does not appear.  The only way I've found to sort this is to untick "enabled" - but then all the functionality stops
  • I can determine lanes by some attributes (Element or Tagged), but not many Eg I can't choose to split lanes by stereotype
  • The ordering seems to change in peculiar ways.  My SQL specifies an order, but once in a lane the elements appear in apparently random orders

As I say, this was the closest I've got to what I wanted - but the number of issues is too great to use it.

Any more ideas?

Thanks
« Last Edit: March 18, 2017, 03:14:38 am by pkerrison »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
TL;DR

Your query above has a syntax error. Try

Code: [Select]
select o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name, o.Scope, o.Status, o.Author, o.Stereotype, op.value AS 'PMO Strategy'
from t_object o
left join t_objectproperties op on op.Object_ID = o.Object_ID
WHERE op.value = 'Customer'
order by o.name

q.

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Thanks for your reply, but that doesn't address the problem I was describing.

To summarise the problem:

I'd like to list elements using a SQL query and for them to be "click-throughable" to their composite diagram.


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Try this one:

Code: [Select]
SELECT d.ea_guid AS CLASSGUID, "Diagram" AS CLASSTYPE, d.Name AS Diagram, o.Name AS Element 
FROM t_diagram d, t_xref x, t_object o
WHERE x.client = o.ea_guid AND x.supplier = d.ea_guid AND x.name = "DefaultDiagram"

q.

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Aha - that's getting closer - thanks!  The listed items with composite diagrams are now "click-throughable" to the correct diagram when I use the SQL Scratch Pad.

However, when I embed a modelview onto a diagram, using the SQL query as the source - the items can no longer be selected.  If I double click on one of them, then the properties dialog for the modelview is shown.

Does anyone know how to get a modelview to allow the listed items to be clickable?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Why does it have to be a modelview?
Can't you just create it as an SQL search and use it from the search window?

Geert

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Why does it have to be a modelview?
Can't you just create it as an SQL search and use it from the search window?

It allows me to include multiple lists of the particular elements on a single diagram.  The diagram is then published to a static HTML website for the rest of the company to consume

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Why does it have to be a modelview?
Can't you just create it as an SQL search and use it from the search window?

It allows me to include multiple lists of the particular elements on a single diagram.  The diagram is then published to a static HTML website for the rest of the company to consume
Ok, that explains why :)
If its only to create a click-though diagram then you could drag the elements from the search onto a diagram, or even automate the whole process using a little script.

Geert

pkerrison

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
The problem is that I have a number of these pages and the tag values change periodically.  They act as landing pages for various entities on the published html site.  The idea being that the user is presented with a list of elements relevant to the entity and can drill down into ones they're interested in.

Manually placing the elements onto the pages is where I started, but quickly becomes a maintenance nightmare as the pages aren't refreshed dynamically as the tag values change.  As a result, it ends up out of date and people lose confidence in the repository.

The closest I've got so far is using the kanban view but you have to manually re-run the searches and you can't bind the lanes to the element stereotype.

It would appear this can't be done, but I'm still open to suggestions if anybody has any. 

I'll try contacting Sparx support directly and see if they can offer anything.

Thanks
« Last Edit: March 28, 2017, 10:56:40 pm by pkerrison »