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: MSC import
Topic Summary: Tcl-API addin to import TauG1 .mpr files
Created On: 4-Jul-2006 10:30
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.
 4-Jul-2006 10:30
User is offline View Users Profile Print this message


David King

Posts: 3
Joined: 14-Oct-2003

Hi,

We are writing a Tcl API addin for TauG2 to import MSCs (TauG1 .mpr files). We are writing our own, since we haven't found anything that is complete, e.g. you can load in trace MSCs using TauTester, but this doesn't support things like co-regions or inline expressions. We really need to support to the full language, at least everything that you can draw using TauG1.

Currently we have 3 issues to solve, if anyone can help that would be greatly appreciated. Thanks.

1) Continuations/References covering only a subset of the lifelines. Currently when we create these, they cover all lifelines, and we haven't figured out how to cover only a subset.

set continuation [u2::Create $sequenceDiagram ContinuationSymbol]

What we would like to set is Participant, which is a list of lifelines that it covers, but this is derived. Does anyone know what it is derived from? Perhaps we have to use the InvolvedFragment?

2) CombinedFragments. We can create a combined-fragment but have trouble placing objects inside it.

set inlineFrameSymbol [u2::Create $sequenceDiagram InlineFrameSymbol]

3) Found messages. We have used the undocumented "Connect" to create messages, but this causes Tau to crash when we create found messages:

set foundMessage [Connect MessageLine 0 $lifeline]

Any documentation, advice, etc is most welcome. Another thought I had was to use the XMI format, but it's unclear to me if TauG2 supports this completely, e.g. I cannot export all elements, like combined fragments, so it's unclear if these can be imported.

Cheers,

David.
Report this to a Moderator Report this to a Moderator
 5-Jul-2006 00:00
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

David

Re: your item 3): the attached script creates a sequence diagram containing (unbound) lost and found messages. I created this script by first creating an example diagram, then using the SDK (FI Debugger) to examine it in detail, and then writing the tcl script to create a similar diagram.

It's intended to be run in a tcl file window in TAU: add a tcl file to the project, paste the script into it, select a package, click in the tcl window and press ctrl-F5. This technique is used only so that the script has a starting point to create the class definitions it uses for the lifelines and the sequence diagram. Actually the class definitions aren't required, but will be useful later (when the script also tries to bind the messages to operations) to check that it is working correctly.

I'm sure that 1) and 2) can be addressed by a similar process, but needs more time than I have free at the moment: if you can't do this yourself please contact your Telelogic account manager because this is definitely something I or other Telelogic PS staff could do for you.

Regards
Ian

-------------------------
=============
Ian Barnard
Principal Consultant
Telelogic UK, an IBM company
Report this to a Moderator Report this to a Moderator
 5-Jul-2006 00:04
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

Here's the script:

#get the package to create things in
set sel [std::GetSelection]
Output "sel=$sel\n"
if { ![u2::IsKindOf $sel Package] } {
Output "Select a package then run this script!!!!!\n"
carp
}

# create classes for out lifelines to bind to
set c1 [u2::Create $sel Class]
u2::SetValue $c1 Name "c1"
set c2 [u2::Create $sel Class]
u2::SetValue $c2 Name "c2"

# create the sequence diagram
set sqd1 [u2::Create $sel SequenceDiagram]
# get the owner of the sequence diagram
set intimp [u2::GetOwner $sqd1]
Output "intimp = $intimp\n"

# create lifelines
set ll1s [u2::Create $sqd1 LifeLineSymbol]
u2::SetValue $ll1s Position "300 300"
set ll1 [u2::GetEntity $ll1s Lifeline]
Output "ll1=$ll1 $ll1s\n"
u2::SetEntity $ll1 Type $c1
set ll2s [u2::Create $sqd1 LifeLineSymbol]
u2::SetValue $ll2s Position "600 300"
set ll2 [u2::GetEntity $ll2s Lifeline]
u2::SetEntity $ll2 Type $c2

# create inline frame symbol
set if1s [u2::Create $sqd1 InlineFrameSymbol]
u2::SetValue $if1s Position "160 650"
u2::SetValue $if1s Size "620 1000"
u2::SetValue $if1s Text "alt"

# create lost message
set lostm1s [u2::Create $sqd1 MessageLine false]
u2::SetEntity $lostm1s Src $ll2s
u2::SetValue $lostm1s SegmentPoints "620 550 900 550"
set msend [u2::Create $intimp MessageSend]
u2::SetEntity $lostm1s SrcActionOccurrence $msend
set lostm1 [u2::Create $intimp Message]
u2::SetEntity $msend Message $lostm1
u2::SetValue $lostm1 IsLostOrFound true

# create found message
set foundm1s [u2::Create $sqd1 MessageLine false]
u2::SetEntity $foundm1s Dst $ll1s
u2::SetValue $foundm1s SegmentPoints "140 550 320 550"
set foundm1 [u2::Create $intimp Message]
set mrec [u2::Create $intimp MessageReceive]
u2::SetEntity $foundm1s DstActionOccurrence $mrec
set foundm1 [u2::Create $intimp Message]
u2::SetEntity $mrec Message $foundm1
u2::SetValue $foundm1 IsLostOrFound true

-------------------------
=============
Ian Barnard
Principal Consultant
Telelogic UK, an IBM company
Report this to a Moderator Report this to a Moderator
 18-Jul-2006 17:59
User is offline View Users Profile Print this message


David King

Posts: 3
Joined: 14-Oct-2003

Hi Ian,

Thanks for the example code. One issue we have noticed with your code, is that if you move a lifeline, the message is doesn't move with it. Any ideas?

David.
Report this to a Moderator Report this to a Moderator
 18-Jul-2006 18:04
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

I didn't test it very extensively; sounds like it needs a little more work. From memory, I think I've seen this happen when the SegmentPoints of the message aren't the same as the coordinates of the things it should end on, i.e. the lifeline (which is halfway between the x extents of the lifeline symbol); check it with the FI Debugger, but it might be something else.

BR
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.