Generating Artifacts with the GUI

In order to generate the files for the Tutorial 1 model, simply start iQgen and select the tutorial's model file. Then set both the target and template directory and start the generation. You will find the generated file in the output directory you chose. The next paragraph will guide you through the process step-by-step.

When you start iQgen you should see the screen below. This is the main screen. All settings necessary for generation can be found right there. The numbers (1-10) in the figure correspond to the 10 simple steps necessary for code generation.

Figure 2.3. Main window with step-by-step marks

Main window with step-by-step marks

Just follow these steps and you will generate some sample code (for this example we suggest that you have installed iQgen under c:\iQgen):

  1. Project Root Path. Enter your project root path here: C:\iQgen\samples\getting_started\tutorial_1

  2. Source Model File. Here you need to set the location of the model file: C:\iQgen\samples\getting_started\tutorial_1\model\tutorial_1.xml

  3. Target Generation Path. This is where the generated files can be found after successful generation: C:\iQgen\samples\getting_started\tutorial_1\out

  4. Template Path. Directory containing the templates: C:\iQgen\samples\getting_started\tutorial_1\templates

  5. Master Template. Select your master template: main.jsp

  6. Load Model. Now that all paths and files are set, you have to load model by clicking the toolbar button.

  7. Generate. Start the generation by clicking the toolbar button.

  8. Output. The output window should now contain the lines shown in the screen shot.

    Note

    Technically the generation is now complete. The following two steps are entirely optional.

  9. Open Generated File. Click on the tab Generated Files and double-click on one of the files. It will be opened in the editor.

  10. New Transformation. Finally you can create a new transformation via File, New Transformation. Just specify a location and a file name (e.g. tutorial_1).

Done. You have successfully created your first set of artifacts from the provided model file.

Tip

The GUI is not the only way you can use iQgen. You may also generate artifacts from the command line or from an Ant build file.