IBM Support

Auto-initialize data attributes, of StaticArray, which contain Reference to a type in IBM Rational Rhapsody

Question & Answer


Question

How do I get code to auto-initialize data attributes when the attribute references a type in IBM Rational Rhapsody?

Cause

Attributes are not being initialized when an attribute in a class references a type in another class.

Answer

There can be a few approaches to resolve this issue.

You have to model this as a relation rather than an attribute/variable. Then you can set the CG::Relation::Implementation to "StaticArray". This will make Rhapsody generate the initialization code.
You may also have to set the CPP_CG::Relation::ScalarContainment to "Pointer", to get the correct reference/pointer syntax generated.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5","Edition":"Rational Rhapsody Developer","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21988610