Configuring the Select transform in a message map

You use the Select transform to retrieve database information and to perform transformations between the input elements and the output elements of the Message Assembly.

Before you begin

Add the database tables to the message map FindAddress.map. For more information, see Adding database tables your message map.

About this task

You can use the Select transform in a message map to enrich a message with database information.

The Select transform retrieves records from a database based on the SQL where clause that you define when you add tables to a message map.

A Select transform has a nested map. This nested map is where you transform the input and output elements of the Message Assembly.

You can set the cardinality of the Input array indexes in the Select transform properties view to work with a particular row or set of rows, or you can leave this field blank to choose all rows.

This section explains how to configure the Select transform when the data available in three database tables is retrieved in one result set.

Procedure

Complete the following steps to enrich a message with the address of a client from the CLIENTS database:

  1. Open the message map FindAddress.map in the Graphical Data Mapping editor.
  2. Connect the database section ResultSet to the message assembly body section FindAddressResponse with a Select transform.

    This figure shows how you connect the database select section ResultSet to the message assembly body section FindAddressResponse with a Select transform

  3. Set the cardinality of the Input array indexes to 1 in the Select transform properties view to indicate that you only wish to work with the first row of the result set returned by the database.

    The following figure shows the Properties tab of the Select transform:

    This figure shows the cardinality of Input array indexes set to 1 in the Properties tab of the Select transform.

  4. Connect the message assembly element Name to the Select transform.

    The following figure shows the element Name connected to the Select transform:

    This figure shows the element Name connected to the Select transform.

  5. Connect the message assembly element Country to the Select transform.

    The following figure shows the element Country connected to the Select transform:

    This figure shows the element Country connected to the Select transform

  6. Navigate into the Select transform, by clicking the icon in the top right of the Select transform.

    The nested map associated to the Select transform opens.

    The following figure shows the nested map with the input and output objects.

    This figure shows the nested map with the input and output objects.

  7. Define the transforms between the database elements and the message assembly output elements. This can be automatically completed by using the Auto map (automap) capability. To manually define each transform complete the following steps:
    1. Connect the input element Name to the output element Name in the message assembly body section FindAddressResponse with a Move transform.
    2. Connect the input element Country to the output element Country in the message assembly body section FindAddressResponse with a Move transform.
    3. Connect the element TYPE to the element Type in the message assembly body section FindAddressResponse with a Move transform.
    4. Connect the element NUMBER to the element Number in the message assembly body section FindAddressResponse with a Move transform.
    5. Connect the elements LINEADDRESS2 and LINEADDRESS1 to the element Street in the message assembly body section FindAddressResponse with a fn:concat transform.
    6. Connect the element POSTCODE to the element Postcode in the message assembly body section FindAddressResponse with a Move transform.
    7. Connect the element CITY to the element City in the message assembly body section FindAddressResponse with a Move transform.
    8. Connect the element ADDITIONALINFO to the element AdditionalInfo in the message assembly body section FindAddressResponse with a Move transform.
    9. Connect the element AREA to the element Area in the message assembly body section FindAddressResponse with a Move transform.
    10. Connect the element PREFIX to the element Prefix in the message assembly body section FindAddressResponse with a Move transform.
    11. Connect the element LOCAL to the element Local in the message assembly body section FindAddressResponse with a Move transform.

Results

You have successfully configured the nested map of the Select transform.

The following figure shows the nested map:

This figure shows the nested map after you define the transforms between database elements and the message assembly output elements.

What to do next

Handle failure of the Select transform in a message map. For more information, see Handling database failures in a Select transform.