Data type issues in transformation - many to one

Last modified by Erik Bakker on 2024/09/03 10:29

In this document, we will use the information from the actual root cause analysis to make a generic view that can be used if you run into the same or a similar problem in the future. Finally, the document will describe the situation, the problem, the analysis, and the result.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Situation

When developing an exit gate as part of an API Gateway, the exit gate run well. The Exit Gate receives an JSON input and transforms that to an XML structure, but when using the Exit Gate with an actual request a log entry is created indicating that the message can't be transformed

2. Problem

The problem in this case was that some messages where processed, whilst other ones where not.

3. Analysis

3.1 Errors in eMagiz

To analyze the problem, we first looked at the errors within the environment to get a sense of the issue at hand. See below for the errors observed. The error indicates that the transformation doesn't work for a specific message. The template rule evaluation error indicates this more specifically as can be seen below.

rca-knowledgebase-multiple-input-datatype-issue-1.png

3.2 Transformation analysis

We have created a small flow that takes the failed message as input for a file-pickup, and then uses the transformation resource from the exit gate to transform. Using a Flow test, you can see what the outcome is and have a better view on the actual location of the transformation problem.

rca-knowledgebase-multiple-input-datatype-issue-2.png

Inspecting the logs resulted in a indication that in the transformation, a target attributes was mapped from multiple input fields. The target attribute data type didn't always match with a mapped source attributes' datatypes. This causes the error in eMagiz. To cross check this, the mapping was slightly changed so that a single input attributes was used with the same data type.

rca-knowledgebase-multiple-input-datatype-issue-3.png

4. Result

Once the mapping was fixed so that the target attributes was always filled with data of the proper data type, the issue didn't occur anymore.

5. Suggested Additional Readings