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 Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21656199