Transforming Tasks
Transform tasks, used to manipulate data available in a mediation exchange, are necessary when the schema of the input, output, or fault message does not match the schema of the message of the expected recipient.
- Create a mediation operation that allows new clients to use legacy services with different schemas. Your new client might need a service that returns an integer for salary information, but the legacy service returns a string.
- Contribute data to the mediation exchange for use in subsequent mediation tasks. For example, you might want to place into a string the time a message was sent, the sender of the message, and the value of one of the elements within a message. You can then use a log task to write the contents of that constructed string to the log file.
Transform tasks have an Input tab that contains the expected schema of the recipient’s message and the data available in the mediation flow.
The message panel contains an XSLT stylesheet that creates the message that the recipient expects. The message panel initially displays the expected schema of the recipient’s message, to give you hints about constructing the message.
The Mediation Operation Context panel contains the data available from the message sender. You can drag items from the context panel to the message panel to perform simple mappings. More complex mappings are also possible through the XPath expression field and by using the right-click menu in the message panel to add XSLT statements.
XPath and XSLT are standard tools for data transformation. Extensive knowledge of XPath or XSLT is not necessary to use the mapper effectively. You can accomplish most transformation usage cases with information available in this chapter and in the Help text available for each XPath function in the product.
If you perform more complex transformations, however, it is helpful to have some detailed references on XPath and XSLT. It is beyond the scope of this manual to provide a complete reference for these tools. You can find the complete XPath and XSLT specification at www.w3.org, and several third-party commercial books are available on both XPath and XSLT.