IBM Support

Running force roundtrip to a class which souces are not changed results in updated Unit file

Troubleshooting


Problem

Attempts to run a force roundtrip to a class element which includes a constractor or destractor in IBM Rational Rhapsody results in the unit file being updated even if the source code is not changed.

Symptom

    Steps to reproduce:
    1. Create a class class_01 includes constructor or destructor
    2. Do code generation on class_01
    3. Backup its unit file (<PackageName>.sbs)
    4. Do force roundtrip on class class_01
    5. Notice that 0 Change(s) is in output window, but a red icon what means change happened is added onto its package icon
    6. Compare the current unit file (<PackageName>.sbs) with the backuped one in step 3

      If a class doesn't include neither constructor nor destructor, there is no change happened on class's both model and unit file after force roundtrip,


    Expected result: No difference exists.


    Actual result:
    • In Rhapsody 7.6: lots of lastModifiedTime, weakCGTime, GUID items are updated.
    • In Rhapsody 8: 2 weakCGTime items are updated.

Cause

This issue was identified as a product defect and logged under APAR PM89850

Resolving The Problem

This defect has been resolved in Rational Rhapsody Fix Pack 4 (7.6.1.4) for 7.6.1 .

WORKAROUND: This problem can be avoided by using the Rhapsody Java/COM API.

Summary: If a model and its source codes are synchronized, it is not necessary to do force roundtrip. So this problem can be avoided by checking whether the model is synchronized with code before force roundtrip, and doing force roundtrip on those asynchronous models and its source codes.

  1. Backup the current source code.
  2. Check the selected elements, add those elements which meet all the below conditions into a target collection for force roundtrip.
    • The element is a class
    • If the element is a nested class, find its root parent which isn't a nested class, and replace the element with its root parent
    • The element doesn't exist in the target collection
    • The element is in the scope of active component
    • The element's source code is existing in the backup taken in Step 1
    • Do code generation, and compare the generated code with its backup to check whether difference exists in source code except the header and footer part.
  3. Restore the backup in Step 1.
  4. Force roundtrip the target collection in Step 2


Attachments:

VB.Net sample
  • PM89850_WorkAround.vb (source code)
  • PM89850_WorkAround.exe (executable file for helper)

Java API Sample
  • PM89850_WorkAround.java (source code)


Instructions:

Note:
The following instructions depend on the use of the attached VB.Net sample; however, the same works for the Java API as well.
  1. Download and unzip executable file PM89850_WorkAround.exe.zip

  2. Create a helper and add the downloaded executable file as shown:



  3. Select class(es) and Right-click

  4. Select the added helper in context menu as follows:



  5. Confirm the executed result

Disclaimer

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

PM89850_WorkAround.exe.zipPM89850_WorkAround.exe.zip
PM89850_WorkAround.java.zipPM89850_WorkAround.java.zip
PM89850_WorkAround.vb.zipPM89850_WorkAround.vb.zip

[{"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;8.0;8.0.1;8.0.2;8.0.3","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21647132