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. To use a custom method in a mapping activity, you need to map it to a target element. This will successfully execute the custom method when you execute the mapping activity in the process flow. 
Prerequisites

  • The package containing the custom java class must be copied in the folder <InstallFolder>/ServerKernel/customClasses.

Declaring a Custom Method 

...

The Value Map feature enables you to define a Map set for a particular value of an element. A Map set enables you to define the mapping values that will be used in the target schema against the values of the elements present in the source schema. For example, if you have a source schema, which has an element, Priority. This element stores the priority levels for the incoming emails and can have the values, Low, Medium, and High. You want to create a Map set for these values and want to map the values in the target schema as:

  • For the source element 'High' the Map value for the target element will be 'H'.
  • For the source element 'Low' the Map value for the target element will be 'L'.
  • For the source element 'Medium' the Map value for the target element will be 'M'.

Scope of a Value Map

You can also select the scope of a Value Map at the time of defining and saving it. Scope of Value Map is the context within which it is defined and can be accessible within or across the user groups. A Value Map can be defined in any of the following scope:

  • Global: The Value Maps defined within Global scope are available within all the mapping activities. Once you create a global Value Map in a mapping activity, you can use it in all the mapping activities.
  • Group: The Value Maps Templates defined within Group scope are available only within the specific user group.


By default, a Value Map is saved in the Global scope and in the Parameter Panel; it is added and displayed under the folder Value Map/Global. If you select to save the Value Map in the Group scope then in the Parameters Panel, it is added and displayed under the folder Value Map/Group. You can also change the scope of a Value Map from Group to Global directly from the Parameters Panel by right-clicking the Value Map and selecting the Move to Global option. However, you cannot change the scope of a Value Map from Global to Group. 
This section covers the following tasks:

  • Defining a Value Map
  • Using a Value Map in Mapping
  • Managing a Value Map from the Parameters Panel

Defining a Value Map

You can define a Value Map by either manually providing the mapping values that will be used in the target schema against the values of the elements present in the source schema in the Value Map Dialog screen or by defining the mapping values that will be used in the target schema against the values of the elements present in the source schema in a CSV file and then loading the CSV file. Loading a CSV file is useful when you have a large set of values to be mapped.

Defining a Value Map Manually

Steps to Manually Define a Value Map

  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. Enter the fully qualified name of the Java class in the Class (PKG) field and press Enter or Tab key to activate the Method field.
  8. Enter the name of the custom method in the Method column and press Enter or Tab key to activate the #Parameter field.
  9. Enter the number of arguments taken by Method in the #Parameter 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

  10. Click OK to close the message. This saves the custom method and displays it under Custom Methods in the Parameters Panel.

Image Removed

Info

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:

  1. Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
  2. Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed. Click Mapping Rules tab.
  3. Select a target element. This displays the selected target element node in the Mapping Graph Area.
  4. Double-click the required custom method under Custom Methods in the Parameters Panel. The selected method node is displayed in the Mapping Graph 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

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

    Image Removed

  9. Click the 

    Image Added

    Elements of Source and Target Schema

  10. Click the Value Map Image Added button on the toolbar or select the option Value Map from the Actions menu. The Value Map Dialog screen is displayed.

    Image Added

    Value Map Options Dialog screen

  11. Enter the name of Value Map (for example, PriorityMap) in the Name textbox.
  12. Select the scope of the Value Map. By default, the radio button Global is selected and a Value Map is saved in the Global scope.

    Info

    If you want to save the Value Map within the current user group, select the Group radio button. This will save the Value Map as the group Value Map and can be used in any mapping activity within the current user group. In the Parameters panel, the Value Map will be displayed under the folder hierarchy Value Map/Group.

  13. Click the Add Image Added button to add a new row for Value and Map columns. You can also add the row by pressing the Enter key. This will add the row immediately next to the row which is currently selected.
  14. You can also provide the default Map value in the Default Value field (for example, Normal). In case if at the source side any value is not provided then the value provided in the Default Value field will be mapped to the target element (see Figure 420). For example, if you want to map the priority of the mail as:
     
      • For the source element 'High' the Map value for the target element will be 'H'.
      • For the source element 'Low' the Map value for the target element will be 'L'.
      • For the source element 'Medium' the Map value for the target element will be 'M'.

    For the source element which is not provided the target element will be mapped to 'Normal' as defined in the Default Value field.


    Image Added
    Value Map

  15. Select the checkbox Pick from Source if you want to use the source element as the map value for the target element or if you do not want to use the default value as the Map value. For example, if there is a source element 'Normal' then the Map value for the corresponding target element will be 'Normal' and for the source element which is not provided the Map value for the target element will also be a blank.

    Info

    If you need to delete any row, select the respective row and click the Delete Image Added button.

  16. Click the Save & Close Image Added button to save the Value Map. This will add the Value Map in Value Map hierarchy in the Parameter Panel. Similarly you can add more Value Map.

Image Added
Parameters Panel

Info

If you need to close the Value Map without saving it, click the Close Image Added button.

 

Defining a Value Map Using a CSV File

The Value Map feature also enables you to load a Comma Separated Values (CSV) file. You can use the set of values from the csv file which are separated by comma as a Map set for your process flow. For example, if you want to change the values defined for the priority of mail as:

  • For the source element 'High' the Map value for the target element is 'H'.
  • For the source element 'Low' the Map value for the target element is 'L'.
  • For the source element 'Medium' the Map value for the target element is 'M'.


Then, you can define the set of values in a csv file as:
Low, L
Medium, M
High, H 
 

Steps to Define a Value Map Using a CSV File

  1. In the Value Map Dialog screen, enter the name of Value Map (for example, PriorityMap_forcsvfile in the Name text box.
  2. Click the CSV Image Added button to load a csv file if you want to map the values using the values defined in the csv file. The server will consider the comma-separated pair of values as the target element and its mapped value.

    Image Added

    Value Map Dialog: Load CSV

    An Open window is displayed

  3. Browse and select the respective CSV file.
  4. Click Open to upload the CSV file. This will populate the Value and Map columns.
  5. Select the scope of the Value Map.
  6. Enter the default value in the Default Value field.

    Image Added

    Value Map Dialog screen

  7. Select the Pick from Source check box, if required.
  8. Click the Save & Close Image Added button to save the Value Map. This will add the Value Map value map in Value Map hierarchy in the Parameter Panel. Similarly, you can add more Value Maps.

Image Added
Parameters Panel

 Using a Value Map in a Mapping

Steps to Use the Value Map in a Mapping

  1. Now to map it, select a target element, for example, Priority. The selected target element is shown in Mapping Graph Area.
  2. Double click on a value map you want to use, from the Value Map hierarchy of Parameter Panel. For example, PriorityMap.
  3. Now double-click the source element. For example, Priority.
  4. Connect the output of the source element to the input of value map and then connect the output of value map to the input of the target element.

    Image Added

    Use Auto Map in a Mapping

  5. Once you have performed the mapping activity, click Apply Mapping ( Image Modified ) button . This maps the custom method to the target element.

    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 activityto save the mapping. The mapping will be applied.

Image Added
Mapping between the Source and Target Schema

Managing a Value Map from Parameters Panel

You can also manage the Value Map from the Parameters Panel. When you right-click the Value Map in the Parameters Panel, you can perform the following operations on a Value Map:

  • Edit the Value Map
  • Move a Value Map from Group to Global
  • Delete a Value Auto Map


Editing a Value Map
In edit mode, you can edit the name of Value Map and the map set for an element value. Note that you cannot edit the scope of a Value Map in edit mode. The radio buttons to select the scope becomes non-editable once you save the Value Map. The radio buttons to select the scope becomes non-editable once you save the Value Map. However, you cannot edit the Value Map when it has been already been used in the mapping and that mapping has been saved. 
 

Steps to Edit a Value Map

  1. In the Properties Panel, select the Value Map to be edited.
  2. Right-click the Value Map and select the option Edit.

    Image Added

    Parameters Panel: Value Map Edit option

    The Value Map is open in Edit mode.

    Image Added

    Value Map Dialog screen in Edit mode

  3. Click the Save & Close Image Added button to save the Value Map.


Moving a Value Map from Group to Global
You can also change the scope of a Value Map from the Parameters Panel by moving the Value Map from Group to Global. However, you cannot move a Value Map if it is has been used in mapping and that mapping has been saved. In addition, you cannot move a Custom Auto Map from Global to Group
 

Steps to Move a Value Map

  1. In the Properties Panel, select the Value Map which you want to move from group to global.
  2. Right-click the Value Map and select the option Move To Global.

    Image Added

    Change Scope in Parameters Panel

  3. A warning message is displayed.

    Image Added

    Warning Message

  4. Click Yes to confirm the change of scope from Group to Global.

Image Added
Change Scope in Parameters Panel


This will add the change the scope of the selected Value Map and now the Value Map will be displayed under the Global folder.
 

Steps to Delete a Value Map

  1. In the Properties Panel, select the Value Map which you want to delete.

  2. Right-click the Value Map and select the option Remove.

    Image Added

    A warning message is displayed.

    Image Added

  3. Click Yes to confirm the deletion of selected Value Map. The selected Value Map will be deleted.