uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

Appendix J.2 Format transformation methods

To transform the formats of data acquired using the database adapter:

  1. Data settings at transformation source and transformation destination
    To transform the formats of the data acquired using the database adapter, use the data transformation definition. Before you begin data format transformation, set up the data transformation source and transformation destination in the Data Transformation Definition screen.
  2. Acquiring the cid attribute value of the column name
    Use the trim node function to acquire the column name ID (cid attribute value).
  3. Settings for the loop node function
    Specify settings for the loop node function such that all the values acquired using the database adapter can be assigned to the transformation destination.
  4. Assigning the values to the column name element at the transformation destination
    Compare the column name ID and the value ID. If the IDs are the same, assign the value to the transformation destination.
  5. Validating the defined contents
    Validate the defined contents and confirm that the mapping is consistent.

The following is a description of each of the steps:

Organization of this subsection
(1) Data settings at transformation source and transformation destination
(2) Acquiring the cid attribute value of the column name
(3) Settings for the loop node function
(4) Assigning the values to the column name element at the transformation destination
(5) Validating the defined contents

(1) Data settings at transformation source and transformation destination

To transform the formats of the data acquired using the database adapter, use the data transformation definition.

In the Data Transformation Definition screen, set up the data acquired using the database adapter in the transformation source schema tree viewer and the XML schema with the post-transformation format in the transformation destination schema tree viewer.

[Figure]

(2) Acquiring the cid attribute value of the column name

In the DBA_ResultSetName element of the response message, the column name and the ID (cid attribute) are stored in pairs. Use the trim node function to acquire the cid attribute corresponding to the column name specified in the node conditions.

To acquire the cid attribute value of the column name:

  1. Define the trim node function for the cid attribute under the DBA_ResultColumnName element.
    For details about how to define the trim node function, see 6.5.5 Removing Spaces from a String.

    [Figure]

  2. In the Trim Node dialog box, click the Set Node Conditions button.
    The Set Node Conditions dialog box appears.
  3. In the Set Node Conditions dialog box, click the Set Conditions button.
    The Set Conditions dialog box appears.
  4. Set up the node conditions.
    Specify the settings as follows:
    • Left-hand side: DBA_ResultColumnName element
    • Right-hand side: Column name (here, Order_number)

      [Figure]

  5. Similarly define the elements for the Customer_code, Product_code, and the Number_of_orders.

    [Figure]

(3) Settings for the loop node function

Map the loop node function from the DBA_ResultSet element of the transformation source to the record element of the transformation destination. For details about how to define the loop node function, see 6.5.16 Mapping Looping.

[Figure]

(4) Assigning the values to the column name element at the transformation destination

Assign a value to each row name element at the transformation destination. In this case, set up the conditions such that the trim node function defined in (2) Acquiring the cid attribute value of the column name matches the cid attribute under the DBA_ResultColumn element.

To assign a value to each row name element of the transformation destination:

  1. Right click the transformation destination element (here, Order_number) and choose Mapping Source.
    The Set Mapping Source dialog box appears.

    [Figure]

  2. In the Mapping Source, select DBA_ResultColumn.

    [Figure]

  3. In the Set Mapping Source dialog box, click the Set Node Conditions button.
    The Set Node Conditions dialog box appears.
  4. In the Set Node Conditions dialog box, click the Set Conditions button.
    The Set Conditions dialog box appears.
  5. Set up the node conditions.
    Specify the settings as follows:
    • Left-hand side: cid attribute under the DBA_ResultColumn element
    • Right-hand side: Trim node function defined to correspond to the transformation destination column name

      [Figure]

  6. Similarly define the elements for the Customer_code, Product_code, and the Number_of_orders.

    [Figure]

(5) Validating the defined contents

Validate whether the defined mapping is consistent. For details about the validation method, see 5.10.2 Validation Method.