IBM Support

How to get complex parameters like enum or struct to show their values in animated sequence diagrams

Question & Answer


Question

Using parameters such as enum or struct during animation will result in their values not appearing in the animated sequence diagrams. The animator only understands the types defined in the rawtypes.h in Rhapsody\Share\Lang\oxf. So how do we get the enum values like {blue, green, yellow} instead of 0,1,2

Answer

Using parameters such as enum or struct during animation will result in their values not appearing in the animated sequence diagrams. The animator only understands the types defined in the rawtypes.h in Rhapsody\Share\Lang\oxf

To display values such as enum {blue, yellow, red} during animation (as opposed to 0,1,2) use the interpreter functions <lang>_CG::Type::AnimSerializeOperation and <lang>_CG::Type::AnimUnserializeOperation

See the Rhapsody -> Help -> Help Topics -> Using Rhapsody -> Animation -> Guidelines for Writing Serialization Functions

Example, the attribute ‘words’ is of an enum type in the tester class is an event reception that takes an enum parameter called tDay

The serialize function converts the values to a textual string, whilst the unserialize reverses this:

Thus upon animation the string appears:

The values should now be displayed in the animated sequence diagram

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.5.1;7.5.0.1;7.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21397691