Versions Compared

Key

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

You can map source and destination layout elements using the various mapping functions built-in the Web Mapper. All these mapping functions comprise of sub-functions, which are used to map elements. 

...

You can use the required sub-function of Math mapping function to map elements. The process of using the Math function is the same for all its sub-functions. Thus, the mapping process using one sub-function is outlined

Anchor
String
String
Using String Function 

The String mapping function enables you to map elements by manipulating strings. It comprises of various sub-functions, which are listed in the table below.  

Steps to map elements using the 'Division' Math Mapping Function 

  1. Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
  2. Select the destination element which you 
  3. Click Math function menu and select the Division sub-function. A div node is displayed in the Mapping Graph Area.

  4. Create a link from the output of the Source element to the first input of the div node.
  5. Create a link from the output of Constant node to the second input of the div node.
  6. Create a link from the output of the div function node to the Target element.

  7. Click Save button. This maps elements using the div sub-function. A line is displayed between the source and target panels showing the mapping of the source element to the target element. 

...

The String mapping function enables you to map elements by manipulating strings. It comprises of various sub-functions, which are listed in the table below.  

Mapping Function

Sub-Functions

Description

Example

String

 

 

 

 

 

 

 

 

 

 

 

Concat

Concatenates the second string after the first string. 
This function accepts only two parameters in graphical mode. However, there is no limitation to the number of parameters in text mode.

concat ('Jane', 'Brown') 
returns the string JaneBrown

Substring

Returns the sub string from the string starting from the specified position and of the specified length. When using this function, you always start counting its position from 1. This implies that the second argument (position) is always greater than or equal to 1.

substring ('abcdef' ,3, 4) 
returns cdef

String

Returns the string value of the argument.

string ('1000') returns the string 1000

Translate

Translates each occurrence of the first argument in the specified string to the second argument. Both the arguments must consist of one or equal number of characters.

translate ('alphabet', 'a','t') 
returns tlphtbet

Substring-after

Returns the string after the specified argument from the string.

substring-after('print=yes', '=') returns yes

Substring-before

Returns the string before the specified argument from the string.

substring-before('print=yes', '=') returns print

Starts-with

Returns true if the string starts with the specified argument or false otherwise.

starts-with ('Sales', 'S')
returns True

String-length

Returns the length of the specified string.

string-length('adeptia') 
returns 7

Contains

Returns true if the string contains the specified argument or false otherwise.

contains ('adeptia', 'tia') 
returns True

Normalize-space

Removes leading and trailing white space (space, tab and new line) from a string, and replaces internal sequences of white space with a single space character.

normalize-space (' Adeptia Inc ' ) returns Adeptia Inc

Name

Returns the name of the source node and field name on which mapping is currently done.

If the context node is an element named<ms:schema>, then 
name () will return ms:schema

Local-name

Returns name with the name prefix. If no prefix was specified, then name and local name are same.

If context node is an element named<ms:schema>, then 
local-name () will return schema

...

 

Steps to map elements using the 'Concat' String Mapping Function 

...

Ensure that the source and target elements to be mapped are selected and displayed in the Mapping Graph Area.

Info

You need to load two source elements for using this mapping function.

...

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

...

Mapping Function

Sub-Functions

Description

Example

String

 

 

 

 

 

 

 

 

 

 

 

Concat

Concatenates the second string after the first string. 
This function accepts only two parameters in graphical mode. However, there is no limitation to the number of parameters in text mode.

concat ('Jane', 'Brown') 
returns the string JaneBrown

Substring

Returns the sub string from the string starting from the specified position and of the specified length. When using this function, you always start counting its position from 1. This implies that the second argument (position) is always greater than or equal to 1.

substring ('abcdef' ,3, 4) 
returns cdef

String

Returns the string value of the argument.

string ('1000') returns the string 1000

Translate

Translates each occurrence of the first argument in the specified string to the second argument. Both the arguments must consist of one or equal number of characters.

translate ('alphabet', 'a','t') 
returns tlphtbet

Substring-after

Returns the string after the specified argument from the string.

substring-after('print=yes', '=') returns yes

Substring-before

Returns the string before the specified argument from the string.

substring-before('print=yes', '=') returns print

Starts-with

Returns true if the string starts with the specified argument or false otherwise.

starts-with ('Sales', 'S')
returns True

String-length

Returns the length of the specified string.

string-length('adeptia') 
returns 7

Contains

Returns true if the string contains the specified argument or false otherwise.

contains ('adeptia', 'tia') 
returns True

Normalize-space

Removes leading and trailing white space (space, tab and new line) from a string, and replaces internal sequences of white space with a single space character.

normalize-space (' Adeptia Inc ' ) returns Adeptia Inc

Name

Returns the name of the source node and field name on which mapping is currently done.

If the context node is an element named<ms:schema>, then 
name () will return ms:schema

Local-name

Returns name with the name prefix. If no prefix was specified, then name and local name are same.

If context node is an element named<ms:schema>, then 
local-name () will return schema


You can use the required sub-function of String mapping function to map elements. The process of using the String function is the same for all its sub-functions. 

Anchor
Date
Date
Using Date Function

...

You can use the required sub-function of Date mapping function to map elements. The process of using the Date function is the same for all its sub-functions. Thus, the mapping process using one sub-function is outlined below. 

Anchor
Aggregation
Aggregation
Using Aggregation Functions  

...

You can use the required sub-function of Aggregation mapping function to map elements. The process of using the Aggregation function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.  

Anchor
Conditional
Conditional
Using Conditional Function 

...

Mapping Function

Sub-Functions

Description

Example

Conditional

IF Conditions

This function comprises of two sub functions:

 

For Filtering Records

Filters the records/elements on basis of the specified condition.

Note: If filtering is applied at the parent record, IFF condition filters the records on the basis of given condition, and ignores the 'Value'.

 If you apply a condition at the child of parent, it returns the 'Value', given that IFF condition gets satisfied.

IFF CONDITION {Age=25} Value= [100] 

Returns the filtered target node-set/node if the Age is 25 in the source record.

 

For Mapping To Elements

Returns a value if the specified condition is true.

IF CONDITION {Age=25} Value= [100] 
Returns 100 if the Age has the value of 25 in the source record.

 

When Condition

Returns a particular value if the specified condition is true, else it returns another value.

WHEN Condition {contains (Email_ID, '@')} Value= [100] Otherwise Value= [200] 

Returns 100 if the Email_ID contains @, else it returns 200.

 

Select Query

This is a customized mapping function. 
Returns the output based on the applied select query on a table in the any of the three databases (Oracle, Sql, IBM DB2).
Select Query supports single field selection and returns first matching record.

SELECT FIELD = [Value1] FROM DB.TAB = [Value2].[Value3] WHERE {Condition} 

Here: 
Value1 = Field name in the table, whose value is to be retrieved 
Value 2 = Name of the Database Info object where the table exists. It contains database location and the user ID and password to connect to that database. 
Value 3 = Name of the table for which the select query is implemented 
Condition = Condition, based on which value is returned 
For example: 
SELECT FIELD = [EMPNO] FROM DB.TAB = [oracle_databaseserver].[EMP] WHERE {ENAME= 'Smith'} 

Returns Employee number of an employee from the table EMP with the name Smith.

SELECT FIELD = [EMPNO] FROM DB.TAB = [oracle_databaseserver].[EMP] WHERE {[ENAME= 'Smith'] AND [AGE = 28]}

 

Sequence

This is a customized mapping function. 
Returns integer values starting from the first argument and incrementing it by the second argument for each record. Both the arguments must be integer constants.

Sequence {10, 20} 

Returns 10, 30, 50….and so on. 

 

Append

This is a customized mapping function. 
Appends the second string after the first string. Used to append only IF Condition.

Append ('IF CONDITION {condition} Value [Value1]', ('IF CONDITION {condition} Value [Value2]' 
Returns IF CONDITION {condition} Value [Value1] Value [Value2] 

 


Some conditional sub-functions are not included in the Data Web Mapper screen, but are implemented by extending the 'IF' and 'When' conditions declared in Table 13. 14 These sub-functions are listed in Table 13below.15.

 

Mapping Function

Sub-Functions

Description

Example

IF Condition

Nested IF

Contains IF condition inside the value of previous IF condition. 
Returns output when all IF conditions are satisfied. 
For example: 
IF CONDITION {condition1} VALUE=[IF CONDITION {condition2} VALUE=[IF CONDITION {condition3} VALUE=[Value1]]] 
Returns Value1 when all IF conditions are satisfied.

IF CONDITION {Age=25} Value= [IF CONDITION {#Designation= 'Manager'} Value = IF CONDITION {Salary= 20000} Value = [100]]] 

Returns 100 if all conditions are satisfied such that a manager of age 25 has a salary of 20000.

When Condition

Nested When

Contains When condition inside the value of previous When condition. 
Returns varied output based on the When conditions being satisfied. 
For example: 
WHEN CONDITION {condition1} VALUE=[WHEN CONDITION {condition2} {VALUE=['value1'] OTHERWISE VALUE=['value2']] OTHERWISE VALUE=['value3'] 
Returns Value1 when both When conditions are satisfied. 
Returns Value3 when the first When condition fails. 
Returns Value2 when the first When condition is satisfied, but the second one fails.


WHEN CONDITION {/employees/employee/Age=25} Value= [WHEN CONDITION {/employees/employee/Designation= 'Manager'} Value = ['100'] OTHERWISE Value = ['200'] OTHERWISE Value = ['300']] 

Returns 100 if both conditions are satisfied such that the employee is a manager of age 25. It returns 300 if the employee is a manager but not of 25 years of age. It returns 200 if the employee is 25 years of age, but is not a manager.

IF and When Condition

IF and When conditions return Boolean

Returns value based on the function used as whether the condition returns True or False. 
If a string or source element contains a character or group of characters, then True is returned, else False is returned. Based on the return value of the condition, the output value is generated. 
For example: 
WHEN CONDITION {contains (var1, str)} VALUE=[var2] OTHERWISE VALUE=[var3] 
If var1 contains str, then True is returned, else False is returned. 
If the condition returns True, then var2 is generated as output, else var1 is the output value.


WHEN CONDITION {contains (var1, str)} Value= ['100'] OTHERWISE Value = ['200'] 

Returns true if Var1 contains Str, else it returns False. If the condition returns true, then this function returns 100, else it returns 200.

IF and When Condition

Mixed 
condition

Contains IF condition inside the value part of When condition or vice versa. 
Returns varied output based on the conditions being satisfied. 
For example: 
WHEN CONDITION {condition1} VALUE=[IF CONDITION {condition2} VALUE=['value1']] OTHERWISE VALUE=['value2'] 
Returns Value1 when both conditions are satisfied. 
Returns Value2 when the first condition fails. 
Returns no output when the first condition is satisfied but second condition fails or when both conditions fail.

WHEN CONDITION {/employees/employee/Salary=50000} Value= IF CONDITION {/employees/employee/Designation= Project Manager} Value = ['100'] OTHERWISE Value = ['200'] 

Returns 100 if the employee is a Project Manager and has a salary of 50000. It returns 200 if the employee is a Project Manager but does not have a salary of 50000.

IF Condition

Multiple IF

Contains IF conditions placed sequentially, with each IF having its value part. 
Two IF conditions are appended using Append sub-function of the String Function. 
Returns varied output based on the condition being satisfied. 
For Example: 
IFCONDITION {condition1} VALUE=['value1'] IF CONDITION {condition2} VALUE=['value2'] 
Returns Value1 if condition1 is satisfied. 
Returns Value2 if condition2 is satisfied.

IF CONDITION {Age=25} Value= ['500'] IF CONDITION {Designation= 'Manager'} Value = [1000] 

Returns 500 if an employee is of age 25. It returns 1000 if an employee is a Manager.

When Condition

When condition with more than one conditions in it.

Contains When condition containing logical operators like and/not to make multiple conditions inside the When condition. 
There are many permutations/combinations for this sub-function. 
Example 1: 
WHEN CONDITION (cond1 and cond2) Value = ['value1'] otherwise value = ['value2'] 
Returns Value1 if both conditions are satisfied, else returns Value2. 
Example 2: 
WHEN CONDITION (cond1 or cond2) Value = ['value1'] otherwise value = ['value2'] 
Returns Value1 when either one or both conditions are satisfied, else returns Value2.

WHEN CONDITION {/employees/employee/Age=25 and /employees/employee/Designation=Manager} Value= ['100'] OTHERWISE Value = ['200'] 

Returns 100 if both conditions are satisfied such that the employee is a manager of age 25. Else it returns 200.

IF Condition

IF condition with more than one conditions in it.

Contains IF condition containing logical operators like and/not to make multiple conditions inside the IF condition. 
There are many permutations/combinations for this sub-function. 
Example 1: 
IF CONDITION (cond1 and cond2) Value = [] 
Returns Value1 when both conditions are satisfied, else no output is returned. 
Example 2: 
IF CONDITION (cond1 or cond2) Value = [] 
Returns Value1 when either one or both conditions are satisfied, else no output is returned.

IF CONDITION {/employees/employee/Age=25 and /employees/employee/Designation=Manager} Value= ['100'] 

Returns 100 if both conditions are satisfied such that the employee is a manager of age 25. Else it returns 200.

...

You can use the required sub-function of Conditional mapping function to map elements. The process of using the Conditional function is the same for all its sub-functions. Thus, the mapping process using one sub-function is outlined below. 
 

 

Anchor
Axis
Axis
Using Axis Function

  1. The Axis function contains a list of advance XSL functions that are used to map elements only when the For Each function is applied on the Target node. It comprises of various sub-functions, which are listed in the table below. 
    Table 18: Sub-Functions of Axis

    Mapping Function

    Mapping Function

    Sub-Functions

    Description

    Example

    Axis

     

     

     

     

     

     

     

     

     

     

     

    File Path – XPath

    This is a customized mapping function. 
    This is an XML Lookup which returns the value of the element/attribute within the XML file whose path is specified. The File path and XPath must be specified in single quotes.

    FilePath ['C:/correct_file.xml'] XPath {'/employees/employee/Name'}

    Returns value of Name element from the file correct_file.xml.

    Self

    Returns the element which is the context node itself.

    Self::Employee

    Returns Employee which is the context node itself.

    Child

    Returns the element which is the child of the context node.

    Child::Name

    Returns Name which is a child of the context node.

    Parent

    Returns the element, which is the parent (if any) of the context node.

    Parent::Name

    Returns Name which is a parent of the context node.

    Following-sibling

    This axis contains all the following siblings of the context node. It returns the first occurrence of the element/attribute in the next sibling of the context node. If the context node is an attribute node or namespace node, then this axis is empty.

    following-sibling: employee/Name

    Returns the first occurrence of Name in the next employee node.

    Ancestor

    Returns the element which is the ancestor of the context node. This axis always includes the root node, unless the context node is the root node.

    Ancestor::Name

    Returns Name which is an ancestor of the context node.

    Ancestor-or-self

    This axis contains the context node and the ancestors of the context node. It always includes the root node. It returns the context node or ancestors of the context node.

    ancestor-or-self::employees/@val

    Returns context node or ancestors of context node.

    Preceding-sibling

    This axis contains all the preceding siblings of the context node. It returns the first occurrence of the element/attribute in the preceding sibling of the context node. If the context node is an attribute node or namespace node, then this axis is empty.

    preceding-sibling: employee/Name

    Returns the first occurrence of Name in the previous employee node.

    Descendant

    Returns the element which is the descendant of the context node. This axis does not contain attribute nodes.

    descendant::Name

    Returns Name, which is a descendant of the context node.

    Descendant-or-self

    This axis contains the context node and the descendants of the context node. It returns the context node or descendants of the context node.

    descendant-or-self::employees/salary

    Returns context node or descendants of context node.

    Generate-id

    Generates a unique id for the element/attribute specified by the XPath argument.

    generate-id (employees/employee/Name)

    Returns unique ID for Name element

    Current

    Removes all tags from the specified xml file and returns the data.

    current()

    Returns data of the xml file without tags.


    You can use the required sub-function of Axis mapping function to map elements. The process of using the Axis function is the same for all its sub-functions.

    Anchor
    Boolean
    Boolean
    Using Boolean Function

    The Boolean mapping function enables you to map elements by applying various logical operators in building Boolean expressions. It comprises of various sub-functions, which are listed in the table below.
    Table 19: Sub-Functions of Boolean Mapping Function

    Mapping Function

    Sub-Functions

    Description

    Example

    Boolean

     

     

     

     

     

     

     

    Equal

    Returns TRUE the first variable argument is equal to the second variable argument.

    (5) = (5)returns true

    Not Equal

    Returns TRUE the first variable argument is not equal to the second variable argument.

    (5) != (50)returns true

    Greater Than

    Returns TRUE the first variable argument is greater than the second variable argument.

    (5)> (3)returns true

    Less Than

    Returns TRUE the first variable argument is less than the second variable argument.

    (5) < (8)returns true

    Greater than Equal

    Returns TRUE the first variable argument is greater than or equal to the second variable argument.

    (5)>= (5)returns true 
    (5)>= (3)returns true

    Less than Equal

    Returns TRUE the first variable argument is less than or equal to the second variable argument.

    (5) <= (8)returns true 
    (5) <= (5)returns true

    Or

    Returns TRUE if either of the two variable arguments evaluate to TRUE otherwise FALSE. These variable arguments can only be of Boolean data type. Hence, their value can either be TRUE or FALSE only.

    (True) Or (True) returns true 
    (True) Or (False)returns true

    And

    Returns TRUE if both of the two variable arguments evaluate to TRUE otherwise FALSE. These variable arguments can only be of Boolean data type. Hence, their value can either be TRUE or FALSE only.

    (True) And (True) returns true 
    (True) And (False)returns false


     A Boolean sub-function is always used in conjunction with a Conditional function. Thus for the process of using the Boolean function, refer to Steps to map elements using the IF Conditional Mapping Function.in conjunction with a Conditional function. 

    Anchor
    Context
    Context
    Using Context Functions

    The Context mapping function enables you to map elements by setting or getting value of process flow context variables.  It comprises of various sub-functions, which are listed in the table below.Table 20: Sub-Functions of Context

    Mapping Function

    Mapping Function

    Sub-Functions

    Description

    Example

    Context

    Set-Context

    This is a customized mapping function. 
    Sets the value of the specified variable argument in the process flow context. This value can be string constant, numeric constant, XPath or output of limited set of mapping function, which can be used before set-context function. 
    This function does not return a value. If mapped to a target element, it creates an empty tag of that target element in output XML.


    set-context ('index', '123')

    sets the value of index variable as 123 in the process flow.

     

    Get-Context

    This is a customized mapping function. 
    Returns the value of the specified variable argument from process flow Context. This value can be string constant, numeric constant, XPath or output of limited set of mapping function. If no value has been set, then the value specified in the second argument is returned.

    get-context ('index', '100')

    Returns the value of index variable from the process flow. If no value has been set for index, then 100 is returned. 

    In get-context function you can also use any variable, which is not declared. In such case get-context creates a variable with the specified name and value, which can be further used with the selected target element. This can be done only in Textual Rule panel.

    You can use the Set-Context sub-function of Context mapping function to set value of the process flow variable and send it to the Process Designer. The Get-Context sub-function is used to return the value of the process flow variable

    .