optimus-logo

Using the orchestration modeler


Purpose

The orchestration modeler provides an alternative way to register transformations in Optimus. It proposes a graphical view of the relationship between the different transformations, helping both developer to build generator and user to understand the generation process. Useful features such as auto-completion and auto-integration within the plugin.xml file are available.

How to use

The registration of transformations with the modeler followed the three steps above :

  • Create the transformation dependency diagram

  • Fill the diagram

  • Add the diagram to the plugin.xml file

Create the transformation dependency diagram

First, Right Click on the package explorer and select New > Other > Examples > TransformationDependency Diagram.

m2m-diagram-creation1

Then, specify the name of the diagram and click on finish.

m2m-diagram-creation2

A new empty diagram was created with the extension .tom.

Fill the diagram

Palette’s element

Let’s focus on the elements available from the palette :

  • TransformationSet is simply a transformation container.

  • TransformationSetExtension allows to extend an existing transformation set by adding new transformations, new relationship between transformations or overwriting transformations (thanks to the priority property).

  • Transformation is a simple transformation.

  • External Transformation allows to reference an existing transformation from another transformation set. These transformation references are always outside a transformation set container and you can’t add a requirement from this transformation.

  • SelfRequirement/ParentRequirement/CustomRequirement specifies the relationship type between two transformations.

See Contributing your own transformations to the M2M Engine to have more details about the element of the palette.

We present how to use the orchestration modeler though a simple example. Make sure that the properties view are open, it’s an essential part to fill de diagram properly.

Simple example

Assume that we have implemented a simple generator with three transformations named PackageCreation, ProgramClassCreation and PredicateCreation.

We want to specify that the ProgramClassCreation self requires the PackageCreation and the PredicateCreation requires ProgramClassCreation as parent. we suppose that the PackageCreation transformation is already declared in another transformation set called Original Set (in another diagram for example).

The first step consist to create the ProgramClassCreation transformation in the diagram. Thus, we need previously to declare a new transformation set and named it Simple Transformation Set for example.

m2m-diagram-fill1

Then we can drag and drop the transformation into the new created set.

m2m-diagram-fill2

In the property view, we can add specific pieces of information to the transformation and its set as described in Contributing your own transformations to the M2M Engine. We can find implementation for transformation set or factory for transformation thanks to a resource selector enabling fast research process.

m2m-diagram-fill3

Now, we want to add the PredicateCreation to the previous created transformation set. Select the ParentRequirement, then draw a line from the PredicateCreation to ProgramClassCreation.

m2m-diagram-fill4

Remains to be added a self requirement from ProgramClassCreation to PackageCreation. As PackageCreation transformation is declared in another transformation set, we create an external transformation. In the property view, we specify the transformation ID. In the diagram, we draw a SelfRequirement as the same way as before.

m2m-diagram-fill5

Last, we can add a two new transformations called ProgramTestClassCreation and ProgramTestLaunchCreation to the Simple Transformation Set transformation set using the extension mecanism. We create a TransformationSetExtension and named it Simple Transformation Set in order to extend the previous transformation set.

m2m-diagram-fill6

We’re adding a self requirement from ProgramTestLaunchCreation to ProgramTestClassCreation as the same way as before.

m2m-diagram-fill7

Add the diagram to the plugin file

To finalize the registration of the transformations within the diagram in Optimus, Right Click on the diagram then Optimus > Add to plugin.xml. Please note that a diagram needs only to be registered one time.

m2m-diagram-add-plugin

With the example diagram, we obtain the transformation list below. Noted that test transformations are in the Simple Transformation Set as expected.

m2m-diagram-result