Running a generator

Provided you have created the generator model, proceed as follows:

  1. In the project explorer view, right-click on the .sgen file containing the generator model. The context menu opens.
  2. In the context menu, select Generate Code Artifacts.
  3. The generator is executed.

The source files the generator produces depend on the generator itself. Each generator makes use of its specific target language and the latter’s features and best practices. For example, the Java generator generates Java interfaces and classes, and the C and C++ generators generate .h header files and .c source files. The location of the generated sources can be changed in the generator model. The respective options are explained in the following section.

The generator model is executed by a so-called Eclipse builder. Thus, the artifacts are generated automatically whenever the statechart is modified, as long as Project → Build Automatically is checked. If you want or need to execute your generator model manually, select Generate Statechart Artifacts from the package explorer's context menu.