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.

[{"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":"8.0.6;8.1;8.1.1;8.1.2;8.1.2.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21701541