![]() |
Telelogic TAU (steve huntington) | ![]() |
Topic Title: Getting values attached to a stereotype Topic Summary: Created On: 4-Apr-2006 09:51 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi, |
|
![]() |
|
![]() |
|
Nitin
GetTaggedValue is along the right lines; you need to then correctly read the value it returns. If you're using tcl, this routine may do want you want (replace or comment the DebugOutput lines as appropriate): # # read a tagvalue from a stname # proc gettagvalue { e tagname stname } { # DebugOutput "tag $tagname st $stname for $e [u2::GetMetaClassName $e]" set instexpression [u2::GetTaggedValue $e "'$stname' (. '$tagname' .)"] # DebugOutput "instvalue = $instexpression\n" if { $instexpression == 0 } { # DebugOutput "St $stname tag $tagname Not found - returning 0\n" return 0 } # DebugOutput "inst type=[u2::GetMetaClassName $instexpression]\n" if { [u2::IsKindOf $instexpression Ident] } { set value [u2::GetValue $instexpression Name] } elseif { [u2::IsKindOf $instexpression ListExpr] } { # combine the list values with \n set value "" foreach e [u2::GetEntities $instexpression Expression] { append value "[u2::GetValue $e ValueString]\n" } } elseif { [u2::IsKindOf $instexpression CharstringValue] } { # DebugOutput "CharstringValue" set value [u2::GetValue $instexpression Value] } else { set value [u2::GetValue $instexpression ValueString] } # DebugOutput " value='$value'\n" return $value } and you should be able to translate this into the equivalent C++ fairly easily. HTH Ian ------------------------- ============= Ian Barnard Principal Consultant Telelogic UK, an IBM company |
|
![]() |
Telelogic TAU
» TAU/Developer
»
Getting values attached to a stereotype
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.