Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

USE:

It can happen that during for example, migration projects field names or structure of the payload may change. The new interface can also generate values in a different order. To be able to execute test cases in such scenarios you can take advantage of the transformation functionality.

XSLT Transformation can be applied on both Input and Output payloads. XSLT Transformation will be stored in a reference test case. This test case will be used afterwards in Automation Object Configuration.

Apart from example below there is separate page with the most common solutions: XSLT transformation examples

EXAMPLE:

Let’s take as an example Interface for Sales Order creation. For some reasons, structure of payload message was changed:

  • the node ‘Quantity’ is now reflected by the node ‘Qty’,

  • the node ‘ProductName’ is now reflected by the node ‘Product’.

If we execute such a test case (with different payload structure) it will surely fail since Qty and Product fields are not mapped correctly:

Differences between the Reference and Current Execution:

We can apply XSLT transformation to solve this issue.

PROCEDURE:

In our case, we need to apply the XSLT mapping to the input message. As mentioned previously, this can be achieved by transformation settings for Automation Object.

  1. Prepare the XSLT mapping for a message. Create a test case with type 10 - PI Manual Inbound and copy your prepared message mapping to the content of the test case. Our example transformation:

    Save the content and the test case.

  2. Open Automation Object configuration (/INT4/IFTT_CONF_MASS or /INT4/IFTT_CONF). Select your Automation Object and open Additional Parameters section.
    There are four parameters for XSLT transformation:

Parameter Name

Description

XSLT_INPUT

Execute XSLT on input payload

XSLT_INP2

Execute XSLT on input payload after variable processing and replacement

XSLT_OUT

Execute XSLT on reference output payload

XSLT_OUTC

Execute XSLT on output payload from current test case execution


Choose parameters based on your requirements (you can use all of them at the same time). In our example we are using XSLT_INPUT as we need to apply transformation to the input payload.


It is also possible to run multiple XSLT transformations at single stage (e.g. XSLT_INPUT). To achieve this maintain multiple additional parameters with the same Parameter name and different value in Group column. Value from Group column will be used to sort the transformations and run them in particular order.

  1. In the Parameter Value column, enter the test case that stores XSLT transformation (the test case created in step 1.). Save the configuration.

Let’s execute our main test case once again (with XSLT transformation).

Test case has been executed correctly. As you can see in Execution Information input message was mapped by xslt program which is stored in a test case 17461.

By using appropriate XSLT mapping you can solve many issues with differences between XML structures in input / output payloads.

  • No labels