UML and SysML to Kotlin - Operation Specification

This section describes the UML and SysML to Kotlin operation.

This page discusses:

Glossary

Acronym Definition
SPO Software Production Operation
BL Behavior Layer
ML Middleware Layer
BSM Behavior Specific Middleware
TSM Target Specific Middleware

Referenced Documents

Document Internal reference
UML & SysMl to Kotlin - Class Code Generator Specification [1]

General Concepts

UML to Kotlin code generation operation is a code generation operation producing Kotlin Code from UML entities. The operation is initiated from a Class or an Interface.

Input Elements

Not applicable

Validation Constraints

Validation Constraints are described in document [1].

Code Generator Specification

Software Production Operation Identity Card

Characteristics Values
Name UML to Kotlin
Nature Component generation
Description This operation generates C++ code for: - UML classes - UML Interfaces - UML Enumerations
Scan description The scan lists - UML Classes - UML Interfaces - UML Enumerations - UML Packages
Supported files Files with extensions: .mdzip .mdxml
Input objects - UML Class - UML Interface - UML Enumeration - UML Package
Return codes -1: Generation is unsuccessful, 1: Generation is Successful, 2: Input data are incorrect, Model contains errors. Code generation cannot be executed.
Feature Generation -50 credits per selected class or interface

Parameters

"report_name" parameter

Attributes Values
Name report_name
Description Optional parameter specifying the name of the validation report. It is possible to use specific options for the name of the report as following: - %time% to be replaced by the UTC date in ISO-8601 format of the validation. Example: 2022-08-31T09:39:45.856814300Z - %input_file_name% to be replaced by the input file name without its extension. Hidden in CATIA Magic.
Type String
Values [Default]
Multiplicity 0..1

"dry_run" parameter

Attributes Values
Name dry_run
Description This parameter is optional. It describes if the generation is executed in dry mode to obtain the log and validation report without producing an ESP assembly model. Hidden in CATIA Magic. Note: This option does not consume any credits.
Type Boolean
Values [Default] Yes / [No]
Multiplicity 0..1

"Validate" parameter

Attributes Values
Name Validate
Description Optional parameter to specify if validate is executed. If the validation is not executed, then no check is performed.
Type Boolean
Values [Default] [Yes] / No
Multiplicity 0..1

"report_html" parameter

Attributes Values
Name report_html
Description Optional parameter to specify if the validation report is generated in HTML. The validated parameter must be defined as True. Hidden in CATIA Magic.
Type Boolean
Values [Default] Yes / [No]
Multiplicity 0..1

Files Specification

The code generator generates Kotlin code compliant with Kotlin Standard Edition.

If no output folder is specified, files are created by default under a root folder having the UML_to_Kotlin name.

Packages are created as folders having the corresponding package name in the model.

Kotlin folder hierarchy

Any character of the class, interface and enumeration name which is different of a digit, an ASCII letter, a -or a _, is replaced by an _ in the generated folder / file.

Example of Kotlin file name: Car_stock.kt

Any class, interface, or enumeration name that is a Kotlin keyword is replaced with an '_' in the generated file name.

Example of Kotlin file name: String_.kt