Book a Demo

Author Topic: Tagged value type listing diagrams  (Read 4815 times)

bart85

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Tagged value type listing diagrams
« on: January 15, 2009, 09:56:23 pm »
Hi everyone,

I recently experienced a problem using tagged value types.  What I would like to do is define a tagged value type that, when used, shows me a list of all diagrams in the project and allows me to pick one.

I previously managed to do so for operations as follows :
In Settings > UML... > tab Tagged Value Types I added the following tagged value :
- name : ExistingOperations
- description : test
- detail : Type=RefGUID;
             Values=Operation;

Creating a tagged value of type 'ExistingOperations' for an element then allows me to pick an operation from the project as the value for this element's newly created tagged value.

I would like to do exactly the same now, listing diagrams instead of operations. More specifically, I would like to attach a tagged value to a part, allowing me to specify on which diagram I modelled that part in more detail.  Since the natural way of doing this - making the element composite - does not seem to work for parts, I thought of tagged values as an alternative...

However, I can't find the appropriate syntax for doing this. Just replacing  Values=Operation by Values=diagram does not seem to do the trick...

Does anyone have an idea how to do this?

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
Re: Tagged value type listing diagrams
« Reply #1 on: January 20, 2009, 11:51:27 am »
I don't quite understand your requirement.... forgetting the solution for the moment, do you simply want to get a list of diagrams that a component appears on?
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

bart85

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Tagged value type listing diagrams
« Reply #2 on: January 22, 2009, 07:42:44 pm »
Quote
I don't quite understand your requirement.... forgetting the solution for the moment, do you simply want to get a list of diagrams that a component appears on?
Thanks for looking at my problem Dave.  
I don't really want to show a list of all diagrams containing a certain component. I will try to explain the problem again :

Some element types (e.g. a use case) can be made "composite" by right-clicking on them and choosing advanced > make composite. For others (e.g. a part), however, this is not possible. Therefore, I am now seeking to find another way to link a diagram to these types of elements that cannot be set to composite.  For instance, if I use a diagram to specify the internals of a part, then how do I explicitate the link between this "black box" part and its dedicated diagram?
I already found a way to use tagged value types for linking elements to operations (as explained above).  If I could do the same for diagrams, I would be able to add a tagged value "InternalsDiagram" to each part, with values restricted to an already existing diagram in the project (to be selected from a list).  However, I don't seem to be able to adjust the "code" in my previous post to offer me a list of diagrams instead of operations.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Tagged value type listing diagrams
« Reply #3 on: January 22, 2009, 08:06:53 pm »
It's not possible because diagrams are not UML elements, connectors or features, so the RefGuid tagged value type does not work for them. There have been feature requests to Sparx to extend the guid references to diagrams, but I don't know what became of them.

Anyway, what is your goal? Do you want to navigate from the part to the corresponding diagram via automation or interactivly? I know of no way to make double click work (and tagged values pointing to diagrams wouldn't help you there either).

But if do not just drag a part from the toolbox to a collaboration, but drag a class from the project browser to it, you'll be offered to create a part with the class as "Property Type". You can set the connection afterwards as well via the "Advanced-Set Property Type" context menu of the part (in the diagram). In both cases, your part will be listed in the project browser as "Part1 :Class1". And the class can be composite and have a diagram beneath it.

bart85

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Tagged value type listing diagrams
« Reply #4 on: February 03, 2009, 10:20:03 pm »
Hi Frank, thanks for your response.

The working method you described in your last paragraph does not seem to fit very well with our way of modelling in EA, though.  Therefore, we still didn't find any good solution to our problem.

To put it simply, we are just trying to link an element to a diagram in EA in such a way that we can retrieve this link through the automation interface (indeed, our goal is not to be able to navigate this link interactively, just to retrieve it in the automation interface would be fine). As I explained earlier, the feature of making an element 'composite' is not a satisfactory solution for us, since this cannot be done for all elements (e.g. parts cannot be made composite).

What we already tried is dragging the diagram to which we want to link an element onto a diagram containing that specific element.  We then chose "Add as diagram frame" in the dialog box, and just linked the element to the diagram frame by means of an association connector.  Apart from the fact that this is a rather messy solution, there doesn't seem to be any way of retrieving the original diagram's Diagram ID from the diagram frame through the automation interface.  Of course we can get the diagram's name from the frame, but in our projects these diagram names aren't unique.  Besides, searching the EA repository for this name would be a heavyweight solution. So again, this does not seem to be a good solution...

Any further help would be greatly appreciated...

bart85

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Tagged value type listing diagrams
« Reply #5 on: February 04, 2009, 02:11:33 am »
Quote
Apart from the fact that this is a rather messy solution, there doesn't seem to be any way of retrieving the original diagram's Diagram ID from the diagram frame through the automation interface.  

After some research today, we seem to have proven ourselves wrong. Through the somewhat obscure property MiscData of the Diagram Frame, we have managed to extract the Diagram ID of the original diagram from the frame.  

Therefore, we are now planning to start dealing with our problem as explained above, by means of diagram frames.  Taking everything into account, that's the best we can come up with in dealing with our problem.

Of course, all remarks still welcome!

bioform

  • EA User
  • **
  • Posts: 230
  • Karma: +0/-0
  • Forty-Two?
    • View Profile
Re: Tagged value type listing diagrams
« Reply #6 on: February 04, 2009, 05:51:42 am »
Instead of a "Diagram Frame", would a "hyperlink" be any better?
Might still be stored the sameway I assume.

The hyperlink title is by default:
<package name> : <diagram name>, so then assuming each diagram name is unique in the package, and the element is located in the same package...

Just an incomplete thought :-?

David
Time is what keeps everything from happening at once, Space is what keeps it all from happening to you. <unknown>