Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected links that should have been relative instead of absolute.

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 destination elements. 

...

Declaring a Custom Method 

  1. Ensure that the source and target schemas destination layouts are loaded and all their elements are listed under their respective nodes.
  2. Click the Add Parameters icon and select Custom Methods to display Create Custom Method window.

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



  4. Enter the fully qualified name of the Java class in the Class field and press Tab key to activate the Method field.
  5. Enter the name of the custom method in the Method column and press Tab key to activate the Params field.
  6. Enter the number of arguments taken by Method in the Params column. A custom method can take any number of arguments.

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

...

To remove a custom method, select the custom method and click the Remove.

Map Custom Method to Destination Element

Once you have created a custom method, you can map it to a target destination element. To map: 

  1. Ensure that the source and target schemas destination layouts are loaded and all their elements are listed under their respective nodes.
  2. Select a destination element . This displays the selected target element node in the Mapping Graph Areaand click Mapping Expression tab from Mapping Functional panel.
  3. Double-click the required custom method under Custom Methods in node in the Parameters Panel. The selected method node is displayed in the Mapping Graph Expression Area.

    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

  4. Click two source elements. The selected source nodes are displayed in the Mapping Graph Area.
  5. Create a link from the output of the first source element to the first input of the custom method node.
  6. Create a link from the output of the second source element to the second input of the custom method node.
  7. Create a link from the output of the custom method node to the input of the target element.

    Image Removed

  8. Click the Apply Mapping ( Image Removed ) button. This

  9. Image Added


  10. Double-click the source element to define the custom method and map it to destination element.

    Image Added

  11.  This maps the custom method to the target element.
  12. Save the mapping activity and exit the Data Mapper.

     You can view and validate the generated mapping XSL,  view the target XML and,  view and validate mapping output, before saving the mapping activity

    Web Mapper.