Pre- Requisites
- JRE 1.6 needs to be installed on your system to open the Data Mapper applet.
- Pop-up Blocker needs to be disabled in the web browser, to open the Data Mapper applet. By default, the Pop-up Blocker is enabled.
...
On the Adeptia Suite homepage, go to Configure > Services > Data Transform and then click Data Mapping.
This action will show you the Manage Data Mapping screen (see Figure 376).
Figure 376: Manage Data Mapping
Click the Create New link. The Create Data Mapping screen is displayed (see Figure 377).
Figure 377: Create Data Mapping
- Enter the name and description of the new mapping activity in the textboxes Name and Description respectively.
Click the Data Mapper button. This displays the Data Mapper screen (refer to Figure 378).
Info If you are starting the Data Mapper on your system for the first time, then a warning message is displayed that prevents you from starting this application. Ignore this message and click Start to continue.
Info If you have read-only permissions, you can view a mapping activity in read-only mode. You can view the applied mapping, create new mapping rules, edit existing mapping rules and even run the simulation. For details, refer to the View Mapping in Read-Only Mode section.
Click Advanced Properties if you want to set options for splitting data. You can split the source data into different chunks. You can specify the size of chunks in terms of the number of records. In the output however, only one file is generated at the location specified in the target activity. To know more about splitting data, refer to the Splitting Source Data section.
Info You can set the Advanced Properties at any time of the mapping activity.
- Once you have set the Advanced Properties, click Save to save the splitting options.
- Understanding Data Mapper Applet
The Data Mapper screen is displayed below:
...
The Data Mapper screen is divided into eight sections. These are outlined as:
- Menu Bar
- Tabs Panel
- Tool Bar
- Source Panel
- Target Panel
- Mapping Functions Panel
- Mapping Graph Area
- Parameters Panel
...
Menu Option | Sub-Option | Function |
---|---|---|
File
| Load Schema | Load a source and target schema activity into the Data Mapper |
Save | Save mapping activity | |
Exit | Exit Data Mapper | |
View
| Enable Tool Tips For Source/Target Tree | Activate or deactivate Tool Tips to be displayed at source or target leaf elements. Tool Tips are always displayed as active for root elements. |
Move Connection Ends | Set the width of connecting lines. By default, it is set to 50px. | |
View Mapping XML | Display generated XML file with line numbers. It is displayed in read-only mode. | |
Actions
| Validate XSL | Validate the generated XSL file. |
Global Custom XSL Before | Add custom XSL code at the top of the mapping XSL. | |
Global Custom XSL After | Add custom XSL code at the bottom of the mapping XSL. | |
On Demand (optimized) loading of XML Schema tree | If the XSD is complex, then this option allows you to process only the root level element and not the complete XSD. Only when you expand the hierarchy elements, it processes the child elements and loads them into the memory. The hierarchy elements expansion is now displayed in the applet. This option is applicable only on XML schemas. It optimizes the processing of XML schemas and loads the XSD elements only up to 2 levels in the source and target panels. You need to click a hierarchy element to load its further child elements. | |
Cache Included Schemas | This is applicable to all XML Schema which uses XMD. This option sets whether or not to cache the included xml schemas instead of inlining them as specified by the XML Specification. | |
Tree Expand Level for Optimized Loading | Defines the hierarchy level up to which the source and target files will be displayed for the schema loaded in Data Mapper. Hierarchy level is defined in the Tree Expand Level Dialog, which is opened when user clicks this menu option. | |
Tree Expand Level for Easy Schema Parser | Defines the hierarchy level up to which the source and target files will process the schema to load it into the Data Mapper. You can define the hierarchy level in the Tree Expand Level Dialog box, it appears when you click on this menu option. | |
Namespace | Manage Namespace | |
Exclude Result Prefixes | Exclude a namespace prefix from the target element | |
Enable DBQuery caching | Enable DBQuery cache. This implies that if the same DBquery is fired on another element, it will generate the result from the existing query, instead of creating a new connection. By default, the DBQuery cache is disabled. | |
Search Element | Search an element in the Source or Target schema hierarchy on the basis of Wild Card character(s) Comments, Data Type, Current Mapping Rules, Documentation, and Extension Node Element in the tree node of the Data Mapper. | |
Set Data Viewer Record Count | Set maximum number of records that can be shown in data viewer | |
Custom Auto Map Options | Add custom options for Auto Mapper | |
Value Map | Add options for value map | |
Enable Quick Splitting | Splits data at source end and merges at target end automatically | |
Import Mapping | Enables to map elements in a pattern that is similar to an existing mapping | |
Set Character Set Encoding for Data Parsing | Enables to set character set encoding for the target schema before mapping the data elements | |
Create Context Schema Definition | Context schema definition contains name of the context variable that you want to map to other element. | |
Filter Unmapped Elements | Filter elements or attributes from appearing in the target XML | |
C Data Section Elements | Enables to define C Data elements for the target schema which will be displayed on the Output section of the Debugger screen | |
XSL Transformer | This option gives you the choice to select the parser that you would want to use to parse your mapping activity in the Data Mapper. | |
Help
| Data Mapper Help | Display online help for the Data Mapper section. |
Mapping Functions Help | Display online help for mapping functions. | |
Tip of the Day | Displays the tips on start up. | |
About Data Mapper | Display the About box for the Data Mapper tool. |
...
Button | Name | Function |
---|---|---|
Data Mapper | Display the Data Mapper screen for mapping source and target elements. | |
XSL | Display the generated XSL code with line numbers for the mapping activity. | |
Debugger | Validate and view output of the mapping activity. |
...
Table 3: Options of Tool Bar
Button | Name | Function |
---|---|---|
Save Mapping | Save mapping activity | |
Remove All Mappings | Remove all the mapping between the source and the target elements | |
Validate XSL | Validate generated XSL | |
Auto Mapper | Map the source and the target elements if the structure of the source and the target schemas and the names of the source and the target elements are similar | |
One to One Mapping | Map all the source and the target elements under a parent element if the number of elements in the source and the target schemas are same | |
Toggle Element Properties | Displays the property of the source or target element, if it is defined in the schema. | |
Value Map | Opens the Value Map Options dialog box. | |
Custom Auto Map | To automatically map elements of source and target schemas where hierarchy and elements are different. | |
XSL Template(s) | To create XSL Template and further manage XSL templates from the Manage XSL Template screen | |
Load Schema | Open source and target schemas |
...
Table 4: Tabs of Mapping Graph Area
Tab | Sub-Tabs | Function |
---|---|---|
Node
| Mapping Rules | Display graphical representation of the mapping of source and target elements. |
Textual Rule | Display the textual code representation of the mapping of source and target elements. | |
Local Variables | Create and define local variables for mapping source and target elements. | |
Properties | Display and set properties for source and target elements. Enables you to add comments for elements and applies sorting rules for target elements. It allows you to set the Disable-Output-Escaping property. | |
Global
| Global Variables | Create and define global variables for mapping source and target elements. |
Custom Methods | Create global methods for mapping source and target elements. | |
Key Functions | Create and define keys for mapping source and target elements. | |
Context Variables | Create and define context variables for mapping source and target elements. | |
Connection Info | Create and define connection info variables for mapping source and target elements. | |
Data Viewer
| Source | Preview Data of the uploaded file at the source end. |
Target | Preview Data at the target end according the uploaded source file and mapping rule applied. |
...
Table 5: Buttons of Mapping Graph Area
Button | Name | Function |
---|---|---|
Apply Mapping | Map the selected source elements to the selected target elements. | |
Remove Mapping | Remove the mapping between the selected source and the target elements | |
Pop Out Parameters Panel | Pop out the Parameters Panel and display it as maximized. | |
Add Global/Local/Context Variable/Key | Add a new global, local, context variable or a key. | |
Save Global / Local /Context Variable/Key | Save a new local, global, context variable or a key. | |
Remove Selected Global/Local /Context Variable/Key | Remove the selected global variable, local variable, context variable or key. | |
Remove all Global/Local/Context Variables/Keys | Remove all existing global variables, local variables, context variables or keys. | |
Clears Global / Local variable name and value text fields | Clear all data entry fields while adding a local or global variable. | |
Add New Method | Add a new custom method. | |
Remove Selected Method | Remove the selected custom method. |
Info |
---|
You can expand the Mapping Graph Area by clicking Maximize () button displayed on the Split Bar below the Source and Target Panels. Similarly, by clicking Minimize () button, you can restore the Mapping Graph Area to its original size. Alternately, you can drag the Split Bar to resize the Mapping Graph Area and Source and Target Panels. |
...
Table 6: Parameters Listed in the Parameters Panel
Parameters | Description |
---|---|
Global Variables | Display a list of all the global variables defined for the mapping of source and target elements in the current mapping object. |
Local Variables | Display a list of all the local variables defined for the mapping of source and target elements in the current mapping object. |
Custom Methods | Display a list of all the methods defined for the mapping of source and target elements in the current mapping object. |
Keys | Display a list of all the keys defined for the mapping of source and target elements in the current mapping object. |
Context Variables | Display a list of all the context variables defined for the mapping of source and target elements in the current mapping object. All context variables created in the Data Mapper are transferred to the Process Flow Designer. |
Templates | Display a list of all the XSL templates created for the mapping of source and target elements in the current mapping object. |
Connection Info | Display a list of all connection info variables. |
Global Methods | Display a list of all class files present in the Custom Classes folder. |
Value Map | Display a list of value maps created for the elements |
Info |
---|
All parameters are displayed in this section as and when they are created in the mapping process. You can remove a parameter by right-clicking the parameter and selecting the Remove option. |
...
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. 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: Compares one string to another string, ignoring case considerations, and returns true or false. Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are the equal ignoring case. Syntax: java:MapperUtilityClass.equalsIgnoreCase('adeptia','ADEPTIA') |
Expand | ||
---|---|---|
| ||
Summary: Checks if the given data string matches the given regular expression. This method accepts following two parameters: data string and regular expression. Syntax: java:MapperUtilityClass.matches('Welcome to Adeptia.com',"(.*)Adeptia(.*)") |
Expand | ||
---|---|---|
| ||
Summary: Replaces all the occurrences of a particular string from the given data string. This method accepts following three parameters - data string, value to be replaced, and the replaced value. Syntax: java:MapperUtilityClass.replaceAll('beauty','y' ,'iful') |
Expand | ||
---|---|---|
| ||
Summary: Replaces the first occurrence of a particular string from the given data string. This method accepts following three parameters - data string, value to be replaced, and the replaced value. Syntax: java:MapperUtilityClass.replaceFirst('adeptia','a' ,'A') |
Expand | ||
---|---|---|
| ||
Summary: Converts the data string to lower case. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.toLowerCase('ADEPTIA') |
Expand | ||
---|---|---|
| ||
Summary: Converts the data string to upper case. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.toUpperCase('adeptia') |
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: Converts the string to hexadecimal representation. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.stringToHex('Adeptia') |
Expand | ||
---|---|---|
| ||
Summary: Inserts a new line just before the start of the data. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.newLineBefore('Adeptia') |
Expand | ||
---|---|---|
| ||
Summary: Inserts a newline at the end of the data. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.newLineAfter('Adeptia') |
Expand | ||
---|---|---|
| ||
Summary: Inserts a new line just before the start of the data and at the end of the data. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.newLineBeforeAndAfter('Adeptia') |
Expand | ||
---|---|---|
| ||
Summary: Generates a random number. This method accepts no input parameter. Syntax: java:MapperUtilityClass.getRandomNumber() |
Expand | ||
---|---|---|
| ||
Summary: Adds or subtracts the number of days to the current date based on the value passed. If the value passed is a positive integer then it will add the passed number of days to the current date and vice versa. This method accepts one integer type parameter only. Syntax: java:MapperUtilityClass.getNextorPreviousDate(2) |
Expand | ||
---|---|---|
| ||
Summary: Converts the date to the Julian date format CCYYDDD. This method accepts following two parameters: date string and the format of the date passed. Syntax: java:MapperUtilityClass.getJulian7FromDate('dd-MM-yyyy','yyyyddd') |
Expand | ||
---|---|---|
| ||
Summary: Converts the Julian date CCYYDDD to the date format. This method accepts following two parameters: Julian date string and the format of the date. Syntax: java:MapperUtilityClass.putJulian7IntoDate('2008354','yyyyMMdd') |
Expand | ||
---|---|---|
| ||
Summary: Increases the date and time stamp by the values specified in the parameters passed. This method accepts following nine parameters: date-time in the string format, date-time in the string format in which you have entered the previous parameter value, date-time in string format in which you want the output, an integer value by which you want to increase the year, an integer value by which you want to increase the month, an integer value by which you want to increase the day, an integer value by which you want to increase the hours, an integer value by which you want to increase the minutes, and an integer value by which you want to increase the seconds. Syntax: java:MapperUtilityClass.dateAdd(‘2013-11-27 HH:mm:ss’, ‘yyyy-MM-dd HH:mm:ss’, ‘MM-dd-yyyy HH:mm:ss’, yyyy, MM, dd, hh, mm, ss) |
Expand | ||
---|---|---|
| ||
Summary: Performs an update operation in the database. This method accepts following two parameters: dBConnectionInfoID and database query. Syntax: java:MapperUtilityClass.executeDbUpdateQuery( $dbInfo,'select * from Table') |
Expand | ||
---|---|---|
| ||
Summary: Performs an insert operation on the database. This method accepts following two parameters: dBConnectionInfoID and database query. Syntax: java:MapperUtilityClass.executeDbInsertQuery($dbInfo,'select * from Table') |
Expand | ||
---|---|---|
| ||
Summary: Performs the delete operation on the database. This method accepts following two parameters: dBConnectionInfoID and database query. Syntax: java:MapperUtilityClass.executeDbDeleteQuery($dbInfo,'select * from Table') |
Expand | ||
---|---|---|
| ||
Summary: Encodes the data as Base64. This method accepts one string type parameter only. Syntax: java:MapperUtilityClass.encodeFileAsBase64('C:\SourceFile.txt') |
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') |
Following are the global methods available in the class 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. Syntax: java:GlobalMethodCall.getDaysLeft(‘yyyy-MM-dd’) |
Expand | ||
---|---|---|
| ||
Summary: Returns the account type of the parameter passed to it. This method accepts one string type parameter only in the <parameter-name> format. It returns following three values: AlphabetNumeric, NumericNumeric, and ErrorData. If you pass an alphabet followed by some numeral then it returns AlphabetNumeric. If you pass numeral followed by another numeral then it returns NumericNumeric. If you pass any other values or do not add a delimiter (-) between the two values then it returns ErrorData. Syntax: java:GlobalMethodCall.getAccountType('alphabet-number-alphabet') java:GlobalMethodCall.getAccountType('number-number-alphabet') |