Creating an object constant

Use these procedures in Mapper for a mapping that will use the MECDataTranslator class.

  1. Double-click a mapping to open it in the Mapper Editor.
  2. On the Mapping Console tab, click the Variables and Constants tab.
  3. Right-click the table and select Create Constant.

    For Object data type you must select a constant and not a variable.

  4. Under the Name column, specify a descriptive name for this constant, for example "myMapping".
  5. In the drop-down arrow for Data Type, select Object.

    If Object is not already listed, add data types in Type Definitions.

  6. Optionally, select Window > Preferences > Mapper > Type Definitions.

    Click Add and specify a name, for example Object.

    Click OK to close the Type Definitions dialog.

  7. Specify the value, use this.
  8. Specify a brief description.

Use a global MECDataTranslator variable and instantiate the object in the first Java function where a data translation is performed or in a generic initialization function. You must instantiate the object before the first data translation is finished. Otherwise, the generation of data translation metadata in Mapper will fail.

You do not need to create several instances of the MECDataTranslator data type because you use the same message standard, message version, and message type as specified for the constructor in the whole mapping.

You can use several instances of local MECDataTranslator. You can also combine the instances of local with instances of a global MECDataTranslator if the name of the object or variable for the local and global MECDataTranslator are not the same.