![]() |
Telelogic TAU (steve huntington) | ![]() |
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 |
![]() |
![]()
|
![]() 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 | |
![]() |
|
I have the following structure (Meta class names and attributes within square brackets): SHO_Intra [Operation; InlineMethod=InteractionImplementation..]
How can I get the list of sequence diagrams defined under the Interaction? |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Hi, Thanks, but that did not work. I got the following error 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] InteractionImplementation of SHO_Intra [MetaClass: Interaction]
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.