Skip to content

howto_EA client generation

travis edited this page Jan 25, 2020 · 7 revisions

Enterprise Architect client generation

We are going to show you how to generate source code from an Enterprise Architect diagram using CobiGen.

Prerequisites

If CobiGen_Templates is not already imported into your workspace, follow the next steps:

  • Click on the Eclipse’s menu File > Import > Existing Projects into Workspace and browse to select the workspaces/main/CobiGen_Templates directory.

  • Click Finish and you should have the CobiGen_Templates as a new project in Eclipse’s workspace.

Also verify that you have the latest templates of CobiGen. Your templates folder must contain the crud_java_ea_uml folder. If you do not see it, please follow the next steps:

  • Download the accumulative patch.

  • Open the zip file and extract its content inside the root folder of your Devonfw distribution Devon-dist_2.4.0/

After following those steps correctly, you should have the latest version of the templates ready to use.

Generation

In this tutorial, we are going to generate the entity infrastructure using as input a class diagram, modelled with Enterprise Architect (EA). First, create a class diagram, an example is shown on figure below:

Eclipse CobiGen generation

When you are finished, you will have to export that UML diagram into an XMI version 2.1 file. This is the file format that CobiGen understands. See below a figure showing this process:

Eclipse CobiGen generation

To open that window, see this tutorial.

After having that exported file, change its extension from xmi to xml. Then create an devon4j project and import the exported file into the core of your devon4j project.

Now we are going to start the generation, right-click your exported file and select CobiGen > Generate, finally select the entity infrastructure increment:

Eclipse CobiGen generation

After following all these steps, your generated files should be inside src\main\java folder. If you want an XMI example, you will find it here.

Clone this wiki locally