Enable model transformation via a report

You can run the following model transformations with a report.

Procedure

  1. Create a report script or open an existing one.
  2. Program the call of the transformation component. The code fragment to do so looks like this:

    var comp = Context.getComponent("MTExecution");

    You need the unique identifier of the transformation. It consists of the transformation category and the GUID of the transformation, for example, Transformation category/a76xxbe1-9d77-14de-7849-005056c00008.

    1. Activate the Administration tab, and navigate to Released transformations. This is where you find the categories.
    2. Select a category and a model transformation.
    3. Click Properties.
    4. The ID box displays the GUID of this specific model transformation.
  3. Either call the components for the model transformation with the corresponding parameters, or use the following code fragments in a report:

    Transformation from one model to another:

    var result = comp.transformModel2Model("<Transformation category>/<Transformation GUID>,<Source model>,<Target group>,<Transformation options>");

    Transformation from a model to an XML file:

    var result = comp.transformModel2XML("<Transformation category>/<Transformation GUID>,<Source model>,<Transformation options>");

    Transformation from an XML file to a model:

    var result = comp.transformXML2Model("<Transformation category>/<Transformation GUID>,<Byte array of source file>,<Target group>,<Transformation options>");

Use the newly created reports to perform the relevant transformation.