Transformation Policy - 6.3

Talend ESB Service Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
Installation and Upgrade
EnrichPlatform
Talend ESB

The Transformation policy allows to apply XSLT transformation to message payloads. The implementation is based on CXF interceptors.

Transformation configuration via Spring

To add the transformation feature to the endpoint, the transformation feature could be used:

Spring configuration

<bean id="xsltFeature" class="org.talend.esb.policy.transformation.feature.TransformationFeature">
    <property name="path" value="etc/requestTransformation.xsl"/>
    <property name="appliesTo" value="provider"/>
    <property name="message" value="request"/>
    <property name="type" value="xslt"/>
</bean>
<jaxws:client id="libraryHttp" serviceName="library:LibraryProvider"
      endpointName="library:LibraryHttpPort"
      address="http://localhost:8080/tesb-library-tutorial/services/LibraryHttpPort"
      serviceClass="org.talend.services.demos.library._1_0.Library">
    <jaxws:features>
        <ref bean="xsltFeature"/>
    </jaxws:features>
</jaxws:client>

Dependencies

When running a participant in servlet-container or as a standalone application, the following dependency should be used in the participant's pom.xml file:

pom.xml for servlet-based or standalone participants

<dependency>
    <groupId>org.talend.esb.policies</groupId>
    <artifactId>transformation-policy</artifactId>
    <version>${project.version}</version>
</dependency>

When running a participant in the Talend Runtime container, in the Require-Bundle section of Felix bundle plugin, the transformation-policy bundle should be mentioned:

OSGi environment pom.xml

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <configuration>
        <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Require-Bundle>
                ...
                transformation-policy
            </Require-Bundle>
        </instructions>
    </configuration>
    <extensions>true</extensions>
</plugin>