Contents

After microservices are connected via routes, transformations can be defined on routes having schema mismatches. In the example shown below, there is a schema mismatch between the Feeder output port and CBR input port and hence the route is shown as a dotted line.

A route transformation can be defined in any one of the following ways:

  • Defining a Mapper Project
  • Providing a Custom XSL
  • Using a Named Configuration
  • Importing from a Zip file


Figure 1: Route Transformation options

Defining a Mapper Project

This operation allows the user to define mappings between the source and target port schema using the Fiorano eMapper.

To define the transformation using eMapper, perform the steps below:

  1. Right-click the route and select the Mapper Project option from the Configure Transformation sub menu.

    Icon

    Route transformation editor will be opened which automatically picks up the schemas on connected ports.

  2. Transformations can be defined on schemas by connecting elements from input structure with output structure elements. Additional computations on elements can also be made by using functions present within the Funclet view.


    Figure 2: Route transformation editor

    Icon

    While the editor is open for defining transformations, the Event Process editor will be in the non-editable state to prevent further changes till the transformation editor is closed. Once the transformation editor is closed it is then possible to edit the transformation.

Once the transformation is defined and closed, the transformation will be set on the route and the route appears bold as in the figure below.


Figure 3: Route with the transformation set

Providing a Custom XSL

To provide a Custom XSL, perform the steps below:

  1. Right-click the route and select Custom XSL from the Configure Transformation menu.
  2. In the Custom XSL dialog box that is displayed, provide the XSL in the first tab and XSL for the JMS Message (if any) in the second tab. Click OK to set the transformation on the route. The XSLT Engine to be used (Xalan / Saxon / XSLTC) can be specified from the drop-down menu in the top right corner.
  3. The XSL provided can be tested by clicking the Test button.
Example

By following the steps mentioned above, set the XSL below as a Route Transformation.

Use this stylesheet as an example. All namespaces are deleted from an XML document.  Expand source

 To test the XSL, click the Test button and provide an XML in the input tab and click Transform. The output will be displayed in the Output tab.


Figure 4: Custom XSL Dialog



Figure 5: Transformed XML

Using a Named Configuration

Transformations can also be saved in the Configuration Repository as Named Configurations and can be used where required.

To Use a Named Configuration as a route transformation, right-click on the route and select Use Named Configuration. Choose the configuration to be used from the list of available named configurations.

Importing from a Zip file

Users can also import previously exported transformations from a .Zip file by selecting the Import from Archive File [.Zip] from the Configure Transformation menu.

To save the transformation defined on a route as an archive file, right-click on the route on which the route transformation is defined and select Save Configuration as  > Archive File.

The transformation defined on the route is executed inside the Peer server. It is advised not to define complex mappings (involving huge schemas and mappings) using Route Transformations since it may affect the Peer server performance. For complex transformations, the XSLT microservice can be used.

To remove a transformation defined on the route, right-click the route and select the Clear Transformation option.

Route transformation can be changed on the route at both configuration time and runtime. During runtime, if the transformation is changed, the changes are automatically deployed to the server. The user need not explicitly synchronize the event process for the changes to take effect.

Icon

To define selectors for the data flow through an event route, refer the Configuring Selectors on Routes section.

Adaptavist ThemeBuilder EngineAtlassian Confluence