uCosminexus Service Platform, Basic Development Guide

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

6.5.19 Converting a Value with the Conversion Table

Use the conversion table to convert the mapping source value and assign this value to the mapping destination.

Organization of this subsection
(1) Function used
(2) Setup procedure

(1) Function used

To convert the mapping source value and assign it to the mapping destination with the conversion table, use the Replace Value Function.

The following figure shows an example wherein the replace value function is used:

Figure 6-20 Usage example of the replace value function

[Figure]

(2) Setup procedure

To convert the mapping source value and assign this value to the mapping destination using a conversion table, first create and save the conversion table. If you specify the information of the created conversion table in a system property file (usrconf.properties), you can use the conversion table. After the conversion table is available for use, define the replace value function.

(a) Creating and saving a conversion table

This sub--section explains how to create and save a conversion table.

Hint
The conversion table that is created is not to be packaged. Therefore, the conversion table can be edited anytime even after the actual operations start in the execution environment. The edited contents are reflected when the system is next started.

Creating a conversion table
Create the conversion table in a csv file. The format of the csv file is as follows:
 
"A01","B01"
"A02","B02"
"A03","B03"
       :
 
Substitute value considering Ann and Bnn coded in a same line as a combination pair. Enclose the string to be substituted in double quotations ("), and code. If the string to be substituted contains double quotation, you can use the double quotation as an escape character. If characters outside the scope of escape are escaped, the escaped characters are ignored and subsequent characters are processed.
Note that you can use the following character codes in the conversion table:
  • MS932
  • UTF8
  • UTF16 (big endian or little endian)
The following table describes the characters to be used to code the conversion table:

Table 6-4 Characters to be used in the conversion table

Target Characters to be used
Start character Start character is not required.
End character One of the following linefeed code:
  • LF (0x0A)
  • CR+LF (0x0D0A)
If the executing OS is UNIX, use LF and for Windows, use CR+LF.

Note:
LF: Linefeed
CR: Carriage return
Intervening separation character Use commas (,).
Note
  • The data coded in the conversion table is handled as a string. Therefore, if a numeric value is entered in the replace value function, it is converted into a string and processed.
  • You cannot specify an empty element for the value to be converted entered.
  • If you want to enter an attribute value, the input value is handled with a normalized value (substituting a tab with a space, continuous spaces with a single space, and so on). Therefore, the search key value coded in the conversion table needs to be considered as a normalized value.
Hint
You can specify whether to convert from Ann to Bnn or from Bnn to Ann, when you define the Replace Value Function.

Saving the conversion table
Save the created conversion table in any location.
(b) Registering in the system property file (usrconf.properties)

After you create a conversion table, register the created conversion table in usrconf.properties. For details about how to register a conversion table, see the contents related to the registration of a conversion table in the manual Cosminexus Service Platform System Setup and Operation Guide.

(c) Defining Replace Value Function

The following is the procedure for using the replace value function to convert the mapping source value and assigning the value to the mapping destination:

  1. From the palette, choose Replace Value function (replace) and deploy in the mapping viewer.
  2. Set up a mapping line.
  3. Open the Replace Value dialog box with one of the following methods:
    • Right click on Replace Value function and choose Setting.
    • Double click on Replace Value function.
    The Replace Value dialog box opens.
    For details about the Replace Value dialog box, see the manual Cosminexus Service Platform Overview.
  4. When a transformation-source node is specified in Input, to specify a condition for the transformation-source node and map it only when this condition is satisfied, click Set Node Condition.
    The Set Node Condition dialog box opens.
    For details about how to set a node condition, see 6.7 Specifying Node Conditions. For details about the Set Node Condition dialog box, see the manual Cosminexus Service Platform Reference.
  5. In Conversion table ID, specify the conversion table name coded in the system property file (usrconf.properties).
  6. In Specify Reference Key, choose either the left or right row of the conversion table as the source for changing the value.
  7. In Operation when search fails, choose the system operation for the case where the input value from the mapping source does not exist in the conversion table.
    To output the default value and assign value to the mapping destination
    Choose the Substitute default value radio button and enter the string to be used as the default value in Value.
    To treat as a conversion error
    Choose the conversion error with a radio button.
  8. Click OK.