You can use inbuilt mapper utility classes and global methods available in the Data Mapper to map the elements. To use methods,
- Access the Data Mapper.
- From the Parameters panel, do the following as per your requirement:
- For mapper utility classes, expand Global Methods > MapperUtilityClass. The list of methods appears. The description of the methods is described later in this section.
- For global methods, expand Global Methods > GlobalMethodCall. The list of methods appears. The description of the methods is described later in this section.
- For mapper utility classes, expand Global Methods > MapperUtilityClass. The list of methods appears. The description of the methods is described later in this section.
- Select the tab to define the mapping from the Mapping Graphic area.
To define mapping graphically, click Mapping Rules tab.
To define mapping textually, click Textual Rules tab.
To define mapping using variables, click Local Variables tab. - Select the appropriate method from the Parameters panel. The definition of the method appears on the selected tab.
Methods Available in the Data Mapper
Following are the methods available in the class MapperUtilityClass are:. Click on the method to know its summary an syntax.
Expand | ||
---|---|---|
| ||
Summary: Returns the character at the specified index. This method accepts following two parameters: data string and an integer index. Syntax: java:MapperUtilityClass.charAt('Adeptia', 3) |
...
Expand | ||
---|---|---|
| ||
Summary: Gets the current date and time from the server and gives the output in the desired Java Time Zone. This method accepts following two parameters: Date/Time format in the data string and Time Zone in the data string. Syntax: java:MapperUtilityClass.getCurrentDate(‘yyyy-MM-dd HH:mm:ss’ , ‘time-zone’) Example, java:MapperUtilityClass.getCurrentDate(‘yyyy-MM-dd HH:mm:ss’ , ‘US/Eastern’) |
Expand | ||
---|---|---|
| ||
Summary: Aborts the mapping. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.abortMapping("Error message") |
...
Expand | ||
---|---|---|
| ||
Summary: Calls RESTful web service. This method accepts following eight parameters. All the parameters should be of String format. Parameter details are as follows:
Syntax: java:MapperUtilityClass.invokeREST('http://www.thomas-bayer.com/sqlrest/PRODUCT/12','GET/POST/PUT/DELETE','data to be sent (optional for get)' ,'application/xml','application/xml','Accept-Charset=utf-8,Cache-Control=no-cache,Content-Type: application/xml','username','password') |
The
Following are the global methods available in the class MapperUtilityClass are:GlobalMehthodCall. Click on the method to know its summary an syntax.
Expand | ||
---|---|---|
| ||
Summary: Returns the present age. This method accepts one string type parameter only in the <parameter-name> format. Syntax: java:GlobalMethodCall.getAge(‘dd-MM-yyyy HH:mm:ss’) |
...
Expand | ||
---|---|---|
| ||
Summary: Returns a value (-1 or 0) depending on the value that you pass in it. This method accepts one string type parameter only in the <parameter-name> format. It returns 0 if the value passed is greater than the current time and returns -1 if the value passed is less than the current time. You have to pass the value in yyyy-MM-dd HH:mm:ss format. This method accepts one string type parameter only in the <parameter-name> format. Syntax: java:GlobalMethodCall.getDaysLeft(‘yyyy-MM-dd’) |
...
Expand | ||
---|---|---|
| ||
Summary: This method returns Returns the account type of the parameter passed initto it. This method accepts one string type parameter only in the <parameter-name> format. It returns 3 following three values: AlphabetNumeric, NumericNumeric, and ErrorData. If you pass an alphabet followed by some numeral then it would return returns AlphabetNumeric. If you pass numeral followed by another numeral then it would return returns NumericNumeric. If you pass any other values or you do not add a delimiter (-) between the two values then , the method would return ErrorData. This method accepts one parameter in String <parameter-name> formatit returns ErrorData. Syntax: java:GlobalMethodCall.getAccountType('alphabet-number-alphabet') java:GlobalMethodCall.getAccountType('number-number-alphabet') |
...