Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: list of Sequence Diagrams given GUID of an Interaction element
Topic Summary:
Created On: 25-Apr-2006 09:05
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Ian Barnard, on Wednesday, April 26, 2006 6:53 AM

Answer:
Nitin

I've just run this script and it works (prints all the diagram names) when I have an interaction selected:

set SHO_Intra [std::GetSelection]
Output "$SHO_Intra [u2::GetMetaClassName $SHO_Intra] [u2::GetValue $SHO_Intra Name]\n"

set intImp [u2::GetEntity $SHO_Intra InlineMethod]
Output "$intImp [u2::GetMetaClassName $intImp]\n"

set sdList [u2::GetEntities $intImp Diagram]
Output "diagram list is: $sdList\n"

foreach d $sdList {
Output "Diagram name is [u2::GetValue $d Name] [u2::GetMetaClassName $d]\n"
}

Output looks like this:

i.235.38b2a480 Operation Interaction1
i.186.3a45e4b0 Interaction
diagram list is: i.288.107b0198 i.288.1aaa7fa8 i.288.38c49180 i.358.1051a210
Diagram name is Sequence diagram1 SequenceDiagram
Diagram name is Sequence diagram2 SequenceDiagram
Diagram name is Sequence diagram3 SequenceDiagram
Diagram name is Use case diagram1 UseCaseDiagram

This definitely works.

HTH
Ian
 25-Apr-2006 09:05
User is offline View Users Profile Print this message


Nitin Bharathy

Posts: 4
Joined: 4-Apr-2006

I have the following structure (Meta class names and attributes within square brackets):

SHO_Intra [Operation; InlineMethod=InteractionImplementation..]
|
|----InteractionImplementation of SHO_Intra [Interaction; Diagram=SD_1,SD_2,..]
......|
......|-----SD_1 [Sequence Diagram]
......|-----SD_2 [Sequence Diagram]


I have the parent element SHO_Intra. Querying that (GetValue) for InlineMethod gives me the GUID of the Interaction, InteractionImplementation of SHO_Intra.

How can I get the list of sequence diagrams defined under the Interaction?

Report this to a Moderator Report this to a Moderator
 25-Apr-2006 09:31
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

In tcl something like this should work (although I haven't tested it), given that SHO_Intra is an interaction (which in the metamodel is an operation stereotyped <<interaction>> ) :

set intImp [u2::GetEntity $SHO_Intra InlineMethod]
set sdList [u2::GetEntities $intImp Diagram]
foreach d $sdList {
#... process the diagram $d
}

Using the SDK Debugger for the version of TAU you're using (hopefully 2.6) you can see for an Interaction (such as $SHO_Intra) that it has a metafeature InlineMethod; click on the value and it has a metafeature called Diagram. The code follows these metafeatures directly, using u2::GetEntity for the InlineMethod because it has multiplicity 1, and u2::GetEntities for Diagram because it has multiplicity (0..*), as you can see in the Debugger.

The Debugger is crucial for understanding exactly how the metamodel is structured; I always build an example of the model I want to read or create and examine it using the Debugger before I start coding.

HTH
Ian

-------------------------
=============
Ian Barnard
Principal Consultant
Telelogic UK, an IBM company


Edited: 25-Apr-2006 at 09:33 by Ian Barnard
Report this to a Moderator Report this to a Moderator
 25-Apr-2006 10:07
User is offline View Users Profile Print this message


Nitin Bharathy

Posts: 4
Joined: 4-Apr-2006

Hi,

Thanks, but that did not work. I got the following error
"0: ill formed object id0 : Cannot interpret this as a ITtdEntity.
    while executing
"u2::GetEntities $intImp Diagram" ".

However, intImp is   i.186.10616750   not zero.

I have the FI Debugger tool and this is what the tool states for SHO_Intra and the Interaction:

(Format: Attribute - Type - Value)

SHO_Intra [MetaClass: Operation]
InlineMethod - Interaction - InteractionImplementation of SHO_Intra

InteractionImplementation of SHO_Intra [MetaClass: Interaction]
Diagram
 SD_1 - Sequence Diagram - SD_1
 SD_2 - Sequence Diagram - SD_2
 SD_3 - Sequence Diagram - SD_3


Please tell me how to overcome this problem.
Thanks,
Nitin

Report this to a Moderator Report this to a Moderator
 25-Apr-2006 10:23
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

Answer Answer
Nitin

I've just run this script and it works (prints all the diagram names) when I have an interaction selected:

set SHO_Intra [std::GetSelection]
Output "$SHO_Intra [u2::GetMetaClassName $SHO_Intra] [u2::GetValue $SHO_Intra Name]\n"

set intImp [u2::GetEntity $SHO_Intra InlineMethod]
Output "$intImp [u2::GetMetaClassName $intImp]\n"

set sdList [u2::GetEntities $intImp Diagram]
Output "diagram list is: $sdList\n"

foreach d $sdList {
Output "Diagram name is [u2::GetValue $d Name] [u2::GetMetaClassName $d]\n"
}

Output looks like this:

i.235.38b2a480 Operation Interaction1
i.186.3a45e4b0 Interaction
diagram list is: i.288.107b0198 i.288.1aaa7fa8 i.288.38c49180 i.358.1051a210
Diagram name is Sequence diagram1 SequenceDiagram
Diagram name is Sequence diagram2 SequenceDiagram
Diagram name is Sequence diagram3 SequenceDiagram
Diagram name is Use case diagram1 UseCaseDiagram

This definitely works.

HTH
Ian

-------------------------
=============
Ian Barnard
Principal Consultant
Telelogic UK, an IBM company
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.