Roundtripping classes

The following table lists the modifications that can be roundtripped in a class implementation file.
Element Change
Constructors and operations
  • Change the name of an argument.
  • When the name is changed, the argument description is lost.
  • You cannot change the argument type.
  • Modify bodies between the //#[ and //#] or --+[ and --+] delimiters.
State actions Modify state actions (transition, entry, exit, and reactions in state) between the delimiters.
State-action actions Modify the state-action actions (in activity diagrams) between the delimiters.
Static attributes Add or modify (but not remove) the initial value.
Note: Actions might appear in the code multiple times.

IBM® Rational® Rhapsody® roundtrips the first occurrence of the action code. If two or more occurrences are modified, the first modified occurrence is roundtripped. One technique is to call an operation in state, state action, and transition actions, eliminating duplication of the action code and possible roundtrip ambiguity.

The following table lists the modifications that can be roundtripped in a class specification file.

Element Change
Arguments Add, remove, and change the type of constructors, operations, and triggered operation arguments.

Changes to argument descriptions in the class specification file are not roundtripped.

Association Add or remove association, directed association, or aggregation.

You must set the CPP_ or JAVA_Roundtrip::Update::AcceptChanges property to the All value.

Attributes
  • Modify the descriptions.

    If there is a blank line at the end of the description, the description is lost.
  • Add or remove attributes.

    You must set the CPP_ or JAVA_Roundtrip::Update::AcceptChanges property to the All value.
  • Modify the name, type, or access of existing attributes.
Classes
  • Modify the descriptions.

    If there is a blank line at the end of the description, the description is lost.
  • Modify the class name.

    In the next code generation, the modified class will be generated to new files, such as
    <new name>.h and <new name>.cpp. When using DMCA, you must close and reopen the class file to reassociate the class text with the proper class in the model.
  • Add a new class.

    The addition will be reflected under the associated package in the model.
Constructors and operations
  • Modify the descriptions.

    If there is a blank line at the end of the description, the description is lost.
  • Add or remove constructors or operations.

    You must set the CPP_ or JAVA_Roundtrip::Update::AcceptChanges property to the All value.
  • For the specification file, modify types for existing operation or constructor arguments, but not their names. For specification and implementation files, you can modify both the type and the name. However, if the change is only in the implementation file, you can only change the name and not the type.
  • Modify return types for existing operations.
Destructors Modify the descriptions.

If there is a blank line at the end of the description, the description is lost.

Nested classes Add, remove, or modify a nested class.
Relations
  • Modify the descriptions.

    If there is a blank line at the end of the description, the description is lost.
  • Modify the role name for an existing relation.

    Given a relation "Class_1* itsClass_1", you can modify the role name itsClass_1. For directed associations, you can also modify the related class Class_1 (for bidirectional association and aggregation, you cannot modify the related class).
Standard operations Modify standard operations to inline, by adding "inline" to the declaration. The definition is generated automatically. The <lang>_CG::Operation::Inline property is set to in_source. As a result, the implementation of the function stays in the implementation file. (The "inline" keyword is added to both, specification and implementation files.)
Triggered operations Modify the descriptions.

If there is a blank line at the end of the description, the description is lost.

User-defined types Add, remove, or modify user-defined types.

Feedback