IBM Support

How to avoid annotations generated in model source file by IBM Rational Rhapsody

Question & Answer


Question

How do you make IBM Rational Rhapsody not generate annotations in model source file.

Cause

By default, Rhapsody would include annotations like "ignore", "auto-generated" in generated source files during code generation.

With these annotations, Rhapsody could understand the code structure and further correctly perform other code related operations like roundtrip, incremental code generation and etc.

If you don't have plan to use roundtrip, probably you prefer to not having auto-generated annotations in your source file.

Answer

  • NOTE

Remove auto-generated annotations from source files would likely cause parser error and other potential issues hence it's not a recommended practise.

  • Possible Solutions
  • 1. Set property [Lang]_CG::ModelElement::SimplifyAnnotations to "None" to remove annotations of model elements from source file.

    2. Remove keyword $annotation from corresponding property located under [Lang]_CG::WriterTemplates category.

    Example: To remove annotations generated inside of operation body, use property C_CG::WriterTemplates::GlobalOperationImp for RiC model and CPP_CG::WriterTemplates::OperationImp property when working with RiC++ model.

    3. Most of auto-generated annotations would be removed from source file after applying above solutions. You could consider utilizing Rhapsody Post Processor feature to completely remove the rest annotations if needed.

Internal Use Only

This technote was generated by Technote Kickstart 1.1.0.87 based on Rational Customer Support PMR 14661,999,672.
View the associated PMR's text via Wellspring at: http://eclient.lenexa.ibm.com:9082/DocFetcher/source/PMR/14661.999.672%20O15/03/18

[{"Product":{"code":"SS7P9W","label":"Rational Rhapsody"},"Business Unit":{"code":"BU005","label":"IoT"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0.6;8.1;8.1.1;8.1.2;8.1.2.1","Edition":""}]

Document Information

Modified date:
17 June 2018

UID

swg21701541