Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A custom method is used to call a function from a custom Java class in a package. It is declared and used globally for all target elements. 

...

  1. Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
  2. Click the 

    Global tab displayed in the Mapping Graph Area. All tabs of the Global tab are displayed.
  3. Click the Custom Methods tab. 

    Image Removed

  4. Click the Add New Method ( Image Removed ) button to add a Custom Method. A row is inserted with the listed columns.
    • Alias
    • Class (PKG)
    • Method
    • # Parameters

    Image Removed

  5. The value 'java' is automatically displayed in the Alias column. This is a read-only field.
  6. Click Alias field and then press Enter or Tab key to activate the Class (PKG) field.
  7. Add Parameters icon and select Custom Methods to display Create Custom Method window .

  8. To add a Custom Method, enter the details in the fields.
    • Class
    • Method
    • Params

    Image Added

  9. Enter the fully qualified name of the Java class in the Class (PKG) field field and press Enter or Tab key to activate the Method field.
  10. Enter the name of the custom method in the Method column and press Enter or press Tab key to activate the #ParameterParams field.
  11. Enter the number of arguments taken by Method in the #ParameterParams column. A custom method can take any number of arguments. However, if you enter a value greater than 4, then a warning message appears.

    Image Removed

    Click OK to close the message

  12. Click Save. This saves the custom method and displays it under Custom Methods in the Parameters Panel.

...

 

To remove a custom method, select the custom method and click the Remove selected method () button.

Alternately, you can edit or delete a custom method from the Parameters Panel itself. For details, refer to the   Managing a Global Variable from Parameter Panel section.

Map Custom Method to Target Element
Once you have created a custom method, you can map it to a target element. To map:

...

.

If the custom method is defined with more than 4 parameters, then double-clicking the custom method will display the warning message. Once you click OK, you need to define the mapping using Textual Rules.

Image Removed

...

Create a link from the output of the custom method node to the input of the target element.

Image Removed

...

Save the mapping activity and exit the Data Mapper.

 

...