Altova UModel 2024 Basic Edition

In order to generate program code, your UModel project must contain a code engineering component that specifies all the code generation details (for example, which classes from the project should be included in code generation, and what should be the target generation directory). As illustrated in the instructions below, the component must meet the following criteria for successful code generation:


The component must have a physical location (directory) assigned to it. Code will be generated in this directory.

The classes or interfaces that take part in code engineering must be realized by the component.

The component must have the property use for code engineering enabled.

To add a component which realizes the desired classes or interfaces:

1.Right-click a package in the Model Tree and select New Element | Component from the context menu. This adds a new Component to the model.

2.In the model tree, click the class or interface that must be realized by the component, and then drag and drop the cursor onto the component (in this example, Class1 from Package1 was dragged onto Component1). This automatically creates a ComponentRealization relation in the Model Tree.


There is also an alternative approach to do this, by creating a Component diagram and then drawing a ComponentRealization relation between the component and the classes or interfaces. For more information, see Component Diagrams.

To prepare a component for code engineering:

1.Select the component in the Model Tree (it is assumed that this component is already realized by at least one class or interface, as explained above).

2.In the Properties window, locate the directory property and set it to the path where you want to generate code.

3.In the Properties window, select the check box use for code engineering.


For example, in the image below, the component Component1 from package Component View is configured to generate Java 8.0 code into the directory C:\codegen:


© 2018-2024 Altova GmbH