IBM Support

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

Technote (FAQ)


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.

Document information

More support for: Rational Rhapsody
General Information

Software version: 8.0.6, 8.1, 8.1.1, 8.1.2, 8.1.2.1

Operating system(s): Windows

Reference #: 1701541

Modified date: 27 May 2015