IBM Support

How to RoundTrip attribute initial value into Rhapsody model

Question & Answer


Question

How do you RoundTrip initialization info of attribute elements back to IBM Rational Rhapsody model?

Cause

In Rhapsody model, you can choose either of below listed two ways to define initial value of attribute elements.

    • Provide initial value directly on each attribute's feature dialogue.
    • Add attribute initialization code in class constructor body via constructor feature dialogue.

Rhapsody Code Generation would take appropriated action according to below related properties.
    • CPP_CG::Operation::DisableAutoGeneratedInitializer
    • CG::Operation::UseDefaultAttributeValues

Compared with above, Rhapsody RoundTrip including Reverse Engineering take different behaviour when dealing with initial value provided attributes.

Answer

If you start Reverse Engineering tool to reverse a class, property CPP_CG::Operation::DisableAutoGeneratedInitializer would be checked for the class automatically during the process. As the result, the attribute initialization code would be brought into class constructor initializer area other than the corresponding attribute feature dialogue.

Similarly, you updated the initialization code on the source file and want to bring the info back to model via roundtripping, you also should make sure property CPP_CG::Operation::DisableAutoGeneratedInitializer is checked before starting roundtrip.

[NOTE]

Rhapsody Reverse Engineering and RoundTrip can only update the attribute initialization info on class constructor initializer.

If you have put initial value on attribute's feature dialogue and also left property CPP_CG::Operation::DisableAutoGeneratedInitializer unchecked, Rhapsody RoundTrip would simply ignore the initialization code and remove the existed initialization code from constructor if it exists.

To overcome above problem, check CPP_CG::Operation::DisableAutoGeneratedInitializer of the class before running RoundTrip.

[{"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.6;7.6.0.1;7.6.1;7.6.1.1;7.6.1.2;7.6.1.3;7.6.1.4;7.6.1.5;8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21656199