Configuring Code Generation

From the configuration diagram, you can select a default configuration, and then add the element for which some code must be generated. Then you can validate and run the configuration.


Before you begin: Create a configuration diagram. See Creating a Configuration Diagram.
Tip: You can use the Flashlight sample model to try out the code generation functionality. In the following procedure, the button element is generated.

Environment: This operation runs locally

  1. From the Code Generation section in the diagram palette, drop a default configuration to the diagram viewer.

    The Code Generation section displays a selection of default configurations:

    Code Generation Description
    • C Code Generation
    • C++ Code Generation
    See:
    Notes:
    Java Code Generation See UML to Java Operations.
    Kotlin Code Generation See UML to Kotlin Operations.

  2. Add a title to the configuration.

    Note: The configuration is surrounded with a red frame, indicating that the source element for the code generation is missing.

  3. From the Containment tree, drop the source element to the title or to the block of the configuration.

  4. If required, double-click the configuration to modify its specifications. See Defining Specification Properties. Example for a C code generation:

    Generic Configuration ParametersDescription
    Elements You can drop the source element from the Containment tree or edit this field.
    Local Path A path to your workspace for storing the result files.
    Validate By default, set to true.
    Store Execution Summary in Model By default, set to false.

    Set to true if you want an execution object to be created in your project (under the configuration element), so that you can view the execution summary of your configuration in the Code Generation Result table.

    Execute On Cloud By default, set to false.

    Set to true to run the operation on the cloud

    SCM Configuration -
    Specific Configuration ParametersExamples
    C Code Generation
    • Standard: Post operation script, Default_pools_size, Central pool size, Code deployment, Compiler, C version, Derive instance graph,
    • Expert: Memory optimization
    C++ Code Generation
    • Standard: Post operation script, Default_pools_size, Central pool size, Code deployment, Compiler, Derive instance graph,
    • Expert: MISRA Ignore, MISRA Violation comment
What's Next
You can then validate the configuration and execute the operation.

See Validating the Model and Running the Operation.