Multiple-Occurring Data in the REST Output Transformation
Multiple-Occurring Data in the REST Output Transformation
The REST Output transformation can receive multiple groups of data and return multiple levels of output data in the response message. Each group of data in the response message is linked by a key.
The following image shows an output mapping that returns multiple orders for a customer:
The
Ports
area of the output mapping has two groups: Customer_Order and Orders. Each group contains a customer number. The customer number becomes the key to link customer data and order data in the response message.
The primary key in the resource definition is Customer_No. Customer_No is a key in Customer_Order. It is a foreign key in Orders. The primary key must contain unique values. When the Data Integration Service processes multiple-occurring orders, it can return all the orders for one customer based on the key. The primary key and the foreign key do not appear in the response message.
The
Output
area of the output mapping contains the response message. You must link an input port to each key in the output.
When the REST Output transformation receives duplicate primary key values, the preview fails with an error.