Fiorano eMapper provides an easy to use graphical user interface – the Visual Expression Builder, used for building simple or complex expressions using several predefined functions. All this can be done by performing simple drag-n-drop of required functions, input nodes and connecting them visually.
The Funclet View provided in the Fiorano eMapper Perspective consists of the Visual Expression Builder. The Visual Expression Builder is shown automatically upon clicking on any node in the Output Structure. The Visual Expression Builder consists of two areas:
- Function palette: A palette listing various functions that can be used while defining mappings between input and output nodes.
- Funclet easel: A canvas where the user can define mappings by adding functions from the palette and nodes from the input and output trees.
The Funclet View displaying a mapping is shown in the figure below.
Figure 1: Funclet View
The mapping shown in above figure concats the values of two nodes from the input structure ( and ) with some constants ( ) using pre-defined string functions ( ) to obtain the value of a node in the output structure ( ).
A mapping usually has:
- Destination node
- Function nodes (optional)
- Source nodes (optional)
Funclet Easel
The Funclet Easel is the basic work area for creating expression based mappings. The user can place the Function nodes as well as the Source or Destination nodes on this area and make the required mappings.
Figure 2: Funclet easel
Source and Destination Nodes
Source Node
The Source node corresponds to a node in the Input Structure Panel. A Source node is shown in the figure below.
Figure 3: Source Node
Destination Node
The Destination node corresponds to a node in the Output Structure Panel. A Destination node is shown in the figure below.
Figure 4: Destination Node
Add Link between two Nodes
To make a link between two nodes placed on the Funclet easel, follow the steps below:
- Click on the gray box on the source building block. A small circle appears, as shown in the figure below. This represents the starting point of the link and the output box of the building block.
Figure 5: Source node
- Now drag-and-drop the mouse to the Destination node's input point, which is again represented by a gray box. A big circle appears on the destination node.
Figure 6: Linking the Source and the Destination node
- Release the mouse. A link between the two nodes is created.
Add Source node to Funclet easel
Drag-and-drop the source node from the Input Structure Panel to the Funclet easel.
Figure 7: Adding Source node to Funclet easel
Add Function node to Funclet easel
- Click the Function node on the Function palette which is to be placed on the Funclet easel.
Figure 8: Selecting the Function node
- Now, move the mouse onto the Funclet easel. This changes the mouse to a?? '' sign, representing that the corresponding function node is selected.
- Now click on the Funclet easel. This places the corresponding function node building block on the Funclet easel.
Alternatively,
- Drag-and-Drop the function node from Function palette to the Funclet easel.
Figure 9: Funclet easel
Add Link between two nodes
To make a link between two nodes placed on the Funclet easel, follow the steps below:
- Click on the gray box on the source building block; a small circle appears. This represents the starting point of the link and the output box of the building block.
Figure 10: Source node
- Now drag-and-drop the mouse to the destination node's input point, which is again represented by a gray box. A big circle appears on the destination node.
Figure 11: Linking the Source and the destination node - Release the mouse; a link between the two nodes is created.
Figure 12: Linking Source and Destination nodes
Delete link between two nodes
To delete a link between two building blocks,
- Click on the ending point of the link and drag it to an empty area in the Funclet easel.
Figure 13: Deleting link - Now, release the mouse. This removes the link between the corresponding nodes.
Delete node from Funclet easel
- Select the corresponding building block and right-click on it; the shortcut menu appears.
Figure 14: Pop-up menu
- Click Delete to delete the selected building block.
Open Function Help
The description for a predefined function can be viewed by clicking Help in the right-click menu of a Function node.
Function Palette
The Function palette contains all the functions logically grouped into different categories:
- Arithmetic Functions
- String Functions
- Boolean Functions
- Control Functions
- Advanced Functions
- JMS Message Functions
- Date-Time Functions
- NodeSet Functions
- Math Functions
- Conversion Functions
- Look-up Functions
- User defined Functions
Fiorano eMapper provides several Arithmetic functions to work with numbers and nodes. This section describes these functions.
Addition
Visual representation
Description: This function calculates and returns the sum of two nodes or numbers.
Input: Two number constants or input structure nodes.
Output: Number
Subtraction
Visual representation
Description: This function subtracts the values of two numbers or nodes.
Input: Two number constants or input structure nodes.
Output: Number
Division
Visual representation
Description: This function obtains and returns the quotient after dividing the values of two nodes or numbers.
Input: Two number constants or input structure nodes.
Output: Number
Modulo
Visual representation
Description: This function returns the remainder after dividing the values of the two nodes or numbers.
Input: Two number constants or input structure nodes.
Output: Number
Multiplication
Visual representation
Description: This function multiplies the values of two nodes or numbers.
Input: Two number constants or input structure nodes.
Output: Number
Floor
Visual representation
Description: This function rounds off the value of the node or number to the nearest lower integer.
Input: A number constant or an input structure node.
Output: Number
Example: The number 3.3 is floored to 3.
Ceiling
Visual representation
Description: This function rounds off the value of the node or number to the nearest higher integer.
Input: A number constant or an input structure node.
Output: Number
Example: The number 25.6 is ceiled to 26.
Round
Visual representation
Description: This function rounds off the value of the preceding node or a number to the nearest integer.
Input: A number constant or an input structure node.
Output: Number
Example: The number 4.8 is rounded off to 5 and 4.2 is rounded off to 4.
Number Function
Visual representation
Description: This function converts the input to a number according to the XPath specifications.
Input: A number constant or an input structure node.
Output: Number based on the following rules:
- Boolean true is converted to 1, and false is converted to 0.
- A node-set is first converted to a string and then converted in the same way as a string argument.
- A string that consists of optional whitespace followed by an optional minus sign followed by a number followed by whitespace is converted to the IEEE 754 number that is nearest to the mathematical value represented by the string; any other string is converted to NaN.
- An object of a type other than the four basic types is converted to a number in a way that is dependent on that type.
Math Functions
Absolute
Visual representation
Description: This function returns the absolute (non-negative) value of a number.
Input: Number
Output: The absolute value of the input
Sin
Visual representation
Description: This function returns the Sine value of the input. The input is in radians.
Input: A number in radians.
Output: The Sine value of the input.
Cos
Visual representation
Description: This function returns the Cosine value of the input. The input is in radians.
Input: A number in radians
Output: The Cosine value of the input
Tan
Visual representation
Description: This function returns the Tan value of the input. The input is in radians.
Input: A number in radians.
Output: The Tan value of the input.
Arc sine
Visual representation
Description: This function returns the Arc Sine value or the Sine Inverse value of the input. The output is in radians.
Input: Number
Output: The Sine Inverse value of the input in radians.
Arc cos
Visual representation
Description: This function returns the Arc Cosine value or the Cosine Inverse value of the input. The output is in radians.
Input: Number
Output: The Cosine Inverse value of the input in radians.
Arc tan
Visual representation
Description: This function returns the Arc Tan value or the Tan Inverse value of the input. The output is in radians.
Input: Number
Output: The Tan Inverse value of the input in radians.
Exponential
Visual representation
Description: This function returns the exponential value of the input.
Input: Any number
Output: The exponential value the input.
Power
Visual representation
Description: This function returns the value of a first input raised to the power of a second number.
Input: Two numbers: the first number is the base, and the second number is the power.
Output: A number that is the result of the above described calculation or NaN in case the value could not be calculated.
Random
Visual representation
Description: This function returns a random number between 0 and 1.
Input: No input
Output: A number between 0 and 1.
Sqrt
Visual representation
Description: This function returns the square root of the input value
Input: A number
Output: A number that is the square root of the input value.
Log
Visual representation
Description: This function returns the natural logarithm (base e) of a numerical (double) value.
Input: A positive numerical value.
Output: The natural logarithm (base e) of the input - a numerical (double) value.
Special cases:
- If the argument is NaN or less than zero, the result is NaN.
- If the argument is positive infinity, the result is positive infinity.
- If the argument is positive zero or negative zero, the result is negative infinity.
String Functions
Fiorano eMapper has several string functions. All the functions accept Unicode strings and are case-sensitive. This section covers the string functions.
XPath
Visual representation
Description: This function evaluates the specified XPath expression and returns the result.
Input: For elements within the first structure of the document, specify the XPath as:
/<root element>/<child element>
Example/school/student
For elements within the second structure onwards, specify the XPath as:
document('<structure name>')/<root element>/<child element>
Example: document('input2')/school/student
Output: Result of the XPath expression.
Concat
Visual representation
Description: This function accepts two or more string arguments and joins them in a specified sequence to a form a single concatenated string.
Input: Two or more string constants or input structure nodes.
Output: A concatenated string.
Example: Concat ("abc", "xyz") returns "abcxyz".
Constant
Visual representation
Description; This function creates a constant building block with a string literal.
Input: String
Output: String
Length
Visual representation
Description: This function returns the length of a string.
Input: A string constant or an input structure node.
Output: Number
Example: Length ("abcd") returns 4
Normalize_Space
Visual representation
Description: This function accepts a string as an argument and removes leading, trailing, and enclosed spaces in the specified string. The unnecessary white spaces within the string are replaced by a single white space character.
Input: A string or an input structure node.
Output: String with no whitespace before, after, or within it.
Example: Normalize_Space(" eMapperTool ") returns "eMapper Tool".
White spaces before and after the string is removed and the white spaces between "eMapper" and "Tool" are replaced by a single blank space.
SubString-After
Visual representation
Description This function accepts two strings as arguments. The first string is the source and the second input string is the string pattern. It returns that part of the first input string that follows the string pattern.
Input: Two string constants or input structure nodes.
Output: String
Example: SubString-After('abcde','bc') returns "de"
SubString-Before
Visual representation
Description: This function accepts two strings as arguments. The first string is the source and the second is the string pattern. The function returns that part of the first input string that precedes the string pattern specified as the second argument to the function.
Input: Two string constants or input structure nodes.
Output: String
Example: SubString-Before('abcde', 'cd') returns 'ab'
SubString-Offset
Visual representation
Description: This function accepts two string constants as argument. The first string is the source and the second string is a numerical value that specifies the offset. The output is that part of the source string which starts from the offset specified as the second argument to the function.
Input: Two string constants or input structure nodes.
Output: String
Example: SubString-Offset('abcde', 3) returns "cde"
SubString-Offset-Length
Visual representation
Description: This function accepts three arguments. The first argument is the source string, the second and third arguments are numerical that specify the offset and the size of the output substring respectively. The output is a substring which starts from the offset specified as the second argument to the function. The number of characters that need to be obtained is specified as the third argument.
Input: Two string constants or input structure nodes and a number.
Output: String
Example: SubString-Offset-Length('abcde', 2, 3) returns "bcd"
Control Function
The following Control functions are available in Fiorano eMapper:
If-Then-Else
Visual representation
Description: This function accepts an input value. The first input is a Boolean value and the second and third are string constants. Based on the Boolean value, the function returns the output. If the Boolean value specified in the first input is TRUE, then the function returns the second input string else it returns the third input string.
Input: Boolean value and a string, an optional string in the same sequence.
Output: The second input string or third input string (if present) depending on the first input Boolean value.
Sort Function
Visual representation
Description: This function accepts two inputs. The first input is a set of nodes and the second input is the value of the nodes. The function sorts the nodes in its first input based on the second input.
Input: Sort (nodes, value)
Output: Sorted nodes as Loop Source
Filter Function
Visual representation
Description: This function accepts two arguments. The first argument is a set of nodes and the second argument is a Boolean value. It filters out and returns the nodes for which the second input value is TRUE.
Input: Filter (node set, bool)
Output: Nodes for which the second input value is true as Loop Source.
Conversion Functions
Fiorano eMapper consists of several Conversion functions to convert numerical from one format to the other. These functions are covered in this section.
Decimal
Visual representation
Description: Converts the first input value having a base that is specified by the second input value to a decimal number.
Input: Two numbers: The first input value is the number to be converted to decimal, and the second input value specifies the base of the first input value.
Output: Number in base 10.
Hex
Visual representation
Description: Converts a decimal number to a hexadecimal (base 16) number.
Input: Decimal number
Output: Hexadecimal (base 16) number
Octal
Visual representation
Description: Converts a decimal number to an octal (base 8) number.
Input: Decimal number
Output: Octal (base 8) number
Binary
Visual representation
Description: Converts a decimal number to a binary (base 2) number.
Input: Decimal number
Output: Binary (base 2) number
Radians
Visual representation
Description: Converts a value in Degrees to a value in Radians.
Input: Number
Output: Number
Degrees
Visual representation
Description: Converts a value in Radians to a value in Degrees.
Input: Number
Output: Number
ChangeBase
Visual representation
Description: The ChangeBase function is used to change a number from one base to another. This function accepts three arguments.
- num- the number to be changed
- fromBase- base of the given number
- toBase- base to which number should be converted
Input: Number
Output: Number
Advanced Functions
Fiorano eMapper provides a number of advanced functions. This section explains all these functions.
CDATA Function
Visual representation
Description: This function accepts a string as an argument and specifies the character data within the string.
Input: String argument or input structure node.
Output: Input string or node text enclosed within the CDATA tag.
Example: CDATA ("string") returns <![CDATA[ string]]>
Position
Visual representation
Description: This function is available for the RDBMS-Update or RDBMS-Delete Output structures only and returns the current looping position.
Input: None
Output: The position of the element in the parent tree.
Example: In an XML tree that has three elements, Position() returns
- 0 for the first element
- 1 for the second, and
- 2 for the third.
Format-Number
Visual representation
Description: This function converts the first argument to a string, in the format specified by the second argument. The first argument can be a real number or an integer, and can be positive or negative.
Input: Two values: The first input is a number, and the second, a string of special characters that specifies the format. These special characters are listed in the following table:
Representation | Signifies | Example |
a digit [0-9] | ### | |
. | the decimal point | ###.## |
, | digit separator | ###, ###.## |
0 | leading and trailing zeros | 000.0000 |
% | inserts a percentage sign at the end | ###.00% |
; | a pattern separator | ##.00;##.00 |
The format string is created by using these characters in any order.
Output: String with the number in the specified format.
Node-Name
Visual representation
Description: This function accepts an element or attribute and returns the name of the particular element or attribute.
Input: A single element or attribute of any type
Output: A string
Count
Visual representation
Description: This function accepts an element or attribute and returns the number of instances of a particular element or attribute.
Input: A single element or attribute of any type
Output: A number
Deep-Copy
Visual representation
Description: Copies the current node completely including the attributes and sub-elements.
Input: An Input structure node
Output: All the contents of the Input structure node – including its attributes and sub-elements.
Param
Visual representation
Description: This function is used to access the runtime parameters by its name. Various properties of Tifosi Document (such as header, message, and attachments) are available as runtime parameters at runtime. The names of these parameters follow the convention given below:
Header Properties | TIF_HEADER<HEADERNAME> |
Message (text) | TIF_BODY_TEXT |
Message (byte) | TIF_BODY_BYTE |
Attachment | TIF_ATTACH<NAME> |
Input: Name of the parameter
Output: Value of the parameter specified
Date-Time Functions
Date-Time functions include:
Date
Visual representation
Description: The Date function returns the date part in the input date-time string or the current date if no input is given. The date returned format is: CCYY-MM-DD
If no argument is given or the argument date/time specifies a time zone, then the date string format must include a time zone, either a Z to indicate Coordinated Universal Time or a + or - followed by the difference between the difference from UTC represented as hh:mm. If an argument is specified and it does not specify a time zone, then the date string format must not include a time zone.
Input: Optionally, a string that can be converted to a date (the string should have the date specified in the following format: CCYY-MM-DD)
Output: A date in the format: CCYY-MM-DD
DateTime
Visual representation
Description: This function returns the current date and time as a date/time string in the following format:
CCYY-MM-DDThh:mm:ss
Where,
- CC is the century
- YY is the year of the century
- MM is the month in two digits
- DD is the day of the month in two digits
- T is the separator between the Date and Time part of the string
- hh is the hour of the day in 24-hour format
- mm is the minutes of the hour
- ss is the seconds of the minute
The output format includes a time zone, either a Z to indicate Coordinated Universal Time or a + or - followed by the difference between the localtime from UTC represented as hh:mm.
Input: This function has no input.
Output: The current date-time in the following format: CCYY-MM-DDThh:mm:ss as described above.
DayAbbreviation
Visual representation
Description: This function returns the abbreviated day of the week from the input date string. If no argument is given, then the current local date/time is used as the default argument.
Input: Optionally, a date-time string
Output: The English day of the week as a three-letter abbreviation: 'Sun', 'Mon', "Tue', 'Wed', 'Thu', 'Fri', or 'Sat'.
DayInMonth
Visual representation
Description: This function returns the day of a date as a number. If no argument is given, then the current local date/time is used as the default argument.
Input: A date-time string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
--MM-DD
---DD
If no input is given, then the current local date/time is used.
Output: A number which is the day of the month in the input string.
DayInWeek
Visual representation
Description: This function returns the day of the week given in a date as a number. If no argument is given, then the current local date/time is used the default argument.
Input: A date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
Output: The day of the week as a number - starting with 1 for Sunday, 2 for Monday and so on up to 7 for Saturday. If the date/time input string is not in a valid format, then NaN is returned.
DayInYear
Visual representation
Description: This function returns the day of a date as a day number in a year starting from 1.
If no argument is given, then the current local date/time, as returned by date-time is used as the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
Output: A number representing the day in a year.
Example: The DayInYear for 2003-01-01 returns 1, where as for 2003-02-01 it returns 32.
DayName
Visual representation
Description: This function returns the full day of the week for a date. If no argument is given, then the current local date/time is used the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
Output: An English day name: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday' or 'Friday'.
DayOfWeekInMonth
Visual representation
Description: This function returns the occurrence of that day of the week in a month for a given date as a number. If no argument is given, then the current local date/time is used as the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
Output: A number that represents the occurrence of that day-of-the-week in a month.
Example: DayOfWeekInMonth returns 3 for the 3rd Tuesday in May.
HourInDay
Visual representation
Description: This function returns the hour of the day as a number. If no argument is given, then the current local date/time is used as the default argument.
Input: A date string in any one of the following formats:
CCYY-MM-DDThh:mm:ss
hh:mm:ss
If the date/time string is not in one of these formats, then NaN is returned.
Output: The hour of the day or NaN if the argument is not valid.
LeapYear
Visual representation
Description: This function returns TRUE if the year given in a date is a leap year. If no argument is given, then the current local date/time is used as the default argument.
Input: Date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
CCYY-MM
CCYY
If the date/time string is not in one of these formats, then NaN is returned.
Output: Boolean value (TRUE/FALSE)
MinuteInHour
Visual representation
Description: This function returns the minute of the hour as a number. If no argument is given, then the current local date/time is used as the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
hh:mm:ss
Output: The minute of the hour or NaN if the argument is not valid.
MonthAbbreviation
Visual representation
Description: This function returns the abbreviation of the month of a date. If no argument is given, then the current local date/time is used as the default argument.
Input: Date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
CCYY-MM
-MM-
OutputThree-letter English month abbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov' or 'Dec'.If the date/time string argument is not in valid, then an empty string ('') is returned.
MonthInYear
Visual representation
Description: This function returns the month of a date as a number. The counting of the month starts from 0. If no argument is given, the current local date/time is used as the default argument.
Input: Date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
CCYY-MM
-MM-
--MM-DD
If the date/time string is not valid, then NaN is returned.
Output: A number representing the month in a year.
Example: 0 for January, 1 for February, 2 for March and so on.
MonthName
Visual representation
Description: This function returns the full name of the month of a date. If no argument is given, then the current local date/time is used as the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
CCYY-MM
-MM-
Output: The English month name: 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November' or 'December'.If the date/time string is not valid, then an empty string ('') is returned.
SecondInMinute
Visual representation
Description: This function returns the second of the minute as a number. If no argument is given, then the current local date/time is used as the default argument.
Input: Optionally, a date string in any of the following formats:
CCYY-MM-DDThh:mm:ss
hh:mm:ss
Output: The second in a minute as a number. If the date/time string is not valid, then NaN is returned.
Time
Visual representation
Description: This function returns the time specified in the date/time string that is passed as an argument. If no argument is given, the current local date/time is used as the default argument. The date/time format is basically CCYY-MM-DDThh:mm:ss.
If no argument is given or the argument date/time specifies a time zone, then the time string format must include a time zone, either a Z to indicate Coordinated Universal Time or a + or - followed by the difference between the difference from UTC represented as hh:mm. If an argument is specified and it does not specify a time zone, then the time string format must not include a time zone.
Input: Optionally, a date/time string in the following format:
CCYY-MM-DDThh:mm:ss
Output: The time from the given date/time string in the following format:
hh:mm:ss
If the argument string is not in this format, this function returns an empty string ('').
WeekInYear
Visual representation
Description: This function returns the week of the year as a number. If no argument is given, then the current local date/time is used as the default argument. Counting follows ISO 8601 standards for numbering: week 1 in a year is the week containing the first Thursday of the year, with new weeks beginning on a Monday.
Input: Optionally, a date/time string in any of the following format:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
Output: The week of the year as a number. If the date/time string is not in one of these formats, then NaN is returned.
Year
Visual representation
Description: This function returns the year of a date as a number. If no argument is given, then the current local date/time is used as a default argument.
Input: Optionally, a date/time string in any of the following format:
CCYY-MM-DDThh:mm:ss
CCYY-MM-DD
CCYY-MM
CCYY
Output If the date/time string is not in one of these formats, then NaN is returned.
NodeSet Functions
SUM
Visual representation
Description: The Sum function sums all numbers in selected nodes.
Input: A nodes that has numerical values only.
Output: The sum of all the nodes. If any of the input nodes is not valid, a NaN value is returned.
DIFFERENCE
Visual representation
Description: The difference function returns the difference between the two node sets that are, in the node set passed as the first argument and the node that are not in the node set passed as the second argument.
Input: Two node sets
Output: Node set
DISTINCT
Visual representation
Description: The distinct function returns a subset of the nodes contained in the node-set passed as the first argument. Specifically, it selects a node N if there is no node in a given node-set that has the same string value as N, and that precedes N in the document order.
Input: A node set
Output: A node
HAS SAME NODE
Visual representation
Description: The has-same-node function returns TRUE if the node set passed as the first argument shares any nodes with the node set passed as the second argument. If there are no nodes that are in both node sets, then it returns FALSE.
Input: Two node sets
Output: Boolean value (TRUE or FALSE)
INTERSECTION
Visual representation
Description The intersection function returns a node set containing the nodes that are within both the node sets passed as arguments to it.
Input: Two node sets
Output: Node set
LEADING
Visual representation
Description: The leading function returns the nodes in the node set passed as the first argument that precede, in document order, the first node in the node set passed as the second argument. If the first node in the second node set is not contained in the first node set, then an empty node set is returned. If the second node set is empty, then the first node set is returned.
Input: Two node sets
Output: Node Set
TRAILING
Visual representation
Description: The trailing function returns the nodes in the node set passed as the first argument that follow, in document order, the first node in the node set passed as the second argument. If the first node in the second node set is not contained in the first node set, then an empty node set is returned. If the second node set is empty, then the first node set is returned.
Input: Two node sets
Output: Node set
HIGHEST
Visual representation
Description: The highest function returns the nodes in the node set whose value is the maximum (numerical) value for the node set.
- A node has this maximum value if the result of converting its string value to a number as if by the number function is equal to the maximum value, where the equality comparison is defined as a numerical comparison using the = operator.
- If any of the nodes in the node set has a non-numeric value, this function returns an empty node set.
Input: A node set
Output: A node set
LOWEST
Visual representation
Description: The lowest function returns the nodes in the node set whose value is the minimum (numerical) value for the node set.
- A node has this minimum value if the result of converting its string value to a number as if by the number function is equal to the minimum value, where the equality comparison is defined as a numerical comparison using the = operator.
- If any of the nodes in the node set has a non-numeric value, this function returns an empty node set.
Input: A node set
Output: A node set
MINIMUM
Visual representation
Description: The minimum function returns the node with the minimum numerical value within the given node-set. If the node set is empty, or if any of the nodes in the node set has a non-numeric value, then NaN is returned.
Input: A node set
Output: A numerical value
MAXIMUM
Visual representation
Description: The maximum function returns the node with the maximum numerical value within the given node set. If the node set is empty, or if any of the nodes in the node set has a non-numeric value, then NaN is returned.
Input: A node set
Output: A numerical value
Boolean Functions
The following boolean (logical) functions are available in eMapper Tool:
Symbol | Function | Description |
---|---|---|
= | Equal | True if both inputs are equal. |
!= | Not Equal | True if both inputs are not equal |
> | Greater than | True if the first input is greater than the second input. |
< | Less than | True if the first input is less than the second input. |
>= | Greater than or Equal | True if the first input is greater than or equal to the second input. |
<= | Less than or Equal | True if the first input is less than or equal to the second input. |
AND | AND | Logical AND of the two inputs (the inputs must be outputs of logical building blocks only). |
OR | OR | Logical OR of the two inputs (the inputs must be outputs of logical building blocks only). |
NOT | NOT | Logical inverse of the input (the input must be the output of logical building block only). |
BOOL | boolean(object) | Converts its argument to a boolean according to the XPath specifications, as follows:
|
AND function
Symbol: AND
Description: This function accepts two boolean expressions as arguments and performs a logical conjunction on them. If both expressions evaluate to TRUE, the function returns TRUE. If either or both expressions evaluate to FALSE, the function returns FALSE.
Input: AND (boolean AND boolean)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Chat.dtd as Input Structure and Valid.dtd as Output Structure. Suppose we want to filter out mails that do not have a message body and the email address is not equal to admin@nobody.com. That is, we want that the isValid node of the Output Structure takes the value true if the length of the Message node of the Input Structure is not equal to zero and the value of the Email node is equal to admin@nobody.com. Therefore,
- Load Input Structure and Output Structure.
- Map the Message node and Email node of Input Structure to the isValid node of the Output Structure.
- Invoke the Function Wizard by Right-clicking on the isValid node.
- The Function Easel opens with the existing mappings.
- Place the BOOL node on the Function Easel.
- Link the output of the Message node to the input of the BOOL node.
Figure 15: Linking Message and BOOL nodes
- Place a Constant node on the Function Easel, and set its value equal to admin@nobody.com.
- Place a = node on the Function Easel.
- Link the outputs of the Email node and Constant node to the inputs of the = node.
Figure 16: Linking the Email and Constant node outputs
- Place an AND node on the Function Easel.
- Link the outputs of the BOOL node and = node to the inputs of the AND node.
- Also, link the output of the AND node to the input of the isValid node.
Figure 17: Linking the AND and = node outputs
- This completes the desired mappings.
BOOL
Symbol: BOOL
Description: This function converts its argument to a boolean according to the XPath specifications which are as follows:
- A number is TRUE if and only if it is neither positive or negative zero nor NaN.
- A node-set is TRUE if and only if it is non-empty.
- A string is TRUE if and only if its length is non-zero.
An object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type.
Input: BOOL (Object)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Chat.dtd as Input Structure and Valid.dtd as Output Structure. Suppose we want to filter out mails that do not have message body. That is, we want that the isMessageExist node of the Output Structure takes the value true if the length of the Message node of the Input Structure is not equal to zero. The BOOL function returns true for a string of length non-zero. Therefore,
- Load Input Structure and Output Structure.
- Map the Message node of Input Structure to the isMessageExist node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the isMessageExist node.
- The Function Easel opens with the existing mappings.
- Place the BOOL node on the Function Easel.
- Link the output of the Message node to the input of the BOOL node.
Figure 18: Linking Message and BOOl nodes
- Link the output of the BOOL node to the input of the isMessageExist node.
Figure 19: Linking BOOL and IsMessageExist nodes - This completes the desired mappings.
Equal
Symbol: =
Description: This function returns TRUE if both the inputs are equal.
Input: = (Object = Object)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Chat.dtd as Input Structure and Valid.dtd as Output Structure. Suppose we want to filter mails coming from a particular email address. That is, we want that the isFromAdmin node of the Output Structure takes the value true if the Email node of the Input Structure has the email address as admin@nobody.com. Then,
- Load Input Structure and Output Structure.
- Map the Email node of Input Structure to the isFromAdmin node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the isFromAdmin node.
- The Function Easel opens with the existing mappings.
- Now place a Constant building block on the Function Easel and set its value equal to admin@nobody.com.
Figure 20: Setting Constant building block value to admin@nobody.com - Now place a = node on the Function Easel.
- Link the outputs of the Email node and Constant node to the inputs of the = node.
- Link the output of the = node to the input of the isFromAdmin node.
Figure 21: Linking = and isFromAdmin node
- This completes the desired mappings.
Less Than
Symbol: <
Description: This function returns TRUE if the first input is less than the second input value.
Input: < (Number < Number)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Numbers.dtd as Input Structure and Results.dtd as Output Structure. Suppose we want that Result node of Output Structure should have the value true if the value of Number1 node is less than the value of the Number2 node of the Input Structure. Then,
- Load Input Structure and Output Structure.
- Map the Number1 and Number2 nodes of Input Structure to the Result node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the Result node.
- The Function Easel shows the existing mappings.
- Place the < node on the Function Easel.
Figure 22: Placing a node on the Function Easel
- Link the outputs of the Number1 node and Number2 node to the inputs of the < node.
- Also, link the output of the < node to the input of the Result node.
Figure 23: Linking < and Result node
- This completes the desired mappings.
Greater than
Symbol: >
Description: This function returns TRUE if the first input is greater than the second input value.
Input: > (Number > Number)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of TotalMarks.dtd as Input Structure and Result.dtd as Output Structure. Suppose we want that the value of the PassStatus node is true if the value of the TotalMarks node of the Input Structure is greater than a constant value 150. Then,
- Load InputStructure and OutputStructure.
- Map the TotalMarks node of Input Structure to the PassStatus node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the PassStatus node.
- The Function Easel opens with the existing mappings.
- Now place a Constant building block on the Function Easel and set its value equal to 150.
Figure 24: Setting the Constant building block to 150
- Place a > node on the Function Easel.
- Link the outputs of TotalMarks node and Constant node to the input of the > node.
- Also, link the output of the > node to the input of the PassStatus node.
Figure 25: Linking the > and PassStatus node
- This completes the desired mappings.
Greater than or Equal function
Function: >=
Input: >= (Number >= Number)
Description: True if the first input is greater than or equal to the second input. Output: True/False
Example:
Consider the example of TotalMarks.dtd as Input Structure and Result.dtd as Output Structure. Suppose we want that the value of the PassStatus node as true if the value of the TotalMarks node of the Input Structure is greater than or equal to a constant value 150. Then,
- Load Input Structure and Output Structure.
- Map the TotalMarks node of Input Structure to the PassStatus node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the PassStatus node.
- The Function Easel opens with the existing mappings.
- Now place a Constant building block on the Function Easel and set its value equal to 150.
Figure 26: Setting the Constant building block to 150
- Place a >= node on the Function Easel.
- Link the outputs of TotalMarks node and Constant node to the input of the >= node.
- Also, link the output of the >= node to the input of the PassStatus node.
Figure 27: Linking the >= and PassStatus nodes
- This completes the desired mappings.
OR
Symbol: OR
Description: This function accepts two boolean expressions as arguments and performs logical disjunction on them. If either expression evaluates to TRUE, the function returns TRUE. If neither expression evaluates to True, the function returns FALSE.
Input: OR ( boolean OR boolean )
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Chat.dtd as Input Structure and Valid.dtdas Output Structure. Suppose we want to receive mails that are sent either from the address admin@nobody.com or aryton@nobody.com that is, we want that the isValid node of the Output Structure takes the value true if the Email node of the Input Structure has the value admin@nobody.com or aryton@nobody.com. Then,
- Load Input Structure and Output Structure.
- Map the Email node of Input Structure to the isValid node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the isValid node.
- The Function Easel opens with the existing mappings.
- Place a Constant node on the Function Easel and set its value equal to admin@nobody.com.
- Place another Constant node and set its value equal to aryton@nobody.com.
Figure 28: Setting the Constant node value to aryton@nobody.com - Now place two = nodes on the Function Easel, and make links.
Figure 29: Placing two = nodes on the Function Easel
- Place a OR node on the Function Easel.
- Link the outputs of the two = nodes to the inputs of the OR node.
- Also, link the output of the OR node to the input of the isValid node.
Figure 30: Linking the OR and isValid nodes
- This completes the desired mappings.
Less Than or Equal
Symbol: <=
Description: This function returns TRUE if the first input is less than or equal to the second input.
Input: <= (Number <= Number)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Numbers.dtd as Input Structure and Results.dtd as Output Structure. Suppose we want that the Result node of Output Structure to have the value true if the value of Number1 node is less than or equal to the value of the Number2 node of the Input Structure. Then,
- Load Input Structure and Output Structure.
- Map the Number1 and Number2 nodes of Input Structure to the Result node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the Result node.
- The Function Easel shows the existing mappings.
- Place the <= node on the Function Easel.
Figure 31: Placing <= node on the Function Easel
- Link the outputs of the Number1 node and Number2 node to the inputs of the <= node.
- Also, link the output of the <= node to the input of the Result node.
Figure 32: Linking outputs of the Number1 and Number2 nodes
- This completes the desired mappings.
NOT
Symbol: NOT
Description: This function accepts a boolean expression as the argument and performs logical negation the expression. The result is a boolean value representing whether the expression is FALSE. That is, if the expression is FALSE, the result of this function is TRUE.
Input: NOT (boolean)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Valid.dtd as Input and Output Structure. Suppose we want to make mails from email address admin@nobody.com as invalid. That is, we want that if the value of isFromAdmin node is true, then the value of isValid is set to false. Then,
- Load Input Structure and Output Structure.
- Map the isFromAdmin node of Input Structure to the isValid node of the Output Structure.
- Invoke the Function Wizard by right-clicking on the isValid node.
- The Function Easel shows the existing mappings.
- Now place a NOT node on the Function Easel.
Figure 33: placing a NOT node on the Function Easel
- Link the output of the isFromAdmin node to the input of the NOT node.
- Also link the output of the NOT node to the input of the isValid node.
Figure 34: Linking theNOT and isValid nodes
- This completes the desired mappings.
Not Equal
Symbol ! =
Description: This function returns TRUE if both the inputs are not equal.
Input != (Object = Object)
Output: Boolean value (TRUE/FALSE)
Example:
Consider the example of Chat.dtd as Input Structure and Valid.dtd as Output Structure. Suppose we want to filter out mails that do not have a message body. That is, we want that the isMessageExist node of the Output Structure takes the value true if the length of the Message node of the Input Structure is not equal to zero. Then,
- Load Input Structure and Output Structure.
- Map the Message node of Input Structure to the isMessageExist node of the Output Structure.
- Invoke the Function Wizard by Right-clicking on the isMessageExist node.
- The Function Easel opens with the existing mappings.
- Now place a Constant building block on the Function Easel and set its value equal to 0.
- Place a Length node on the Function Easel.
- Link the output of the Message node to the input of the Length node.
Figure 35: Linking the Message and Length nodes
- Place a != node on the Function Easel.
- Link the outputs of the Length node and Constant node to the inputs of the != node.
- Also, link the output of the != node to the input of the isMessageExist node.
Figure 36: Linking the !=and isMessageExist nodes - This completes the desired mappings.
IsNumber
Symbol: IsNumber
Description: This function returns TRUE if the input value is a number.
Input: Any value
Output: Boolean value (TRUE/FALSE)
Lookup functions
The functions in this category are used to perform the lookup of keyvalue pairs in a database and return the result in sorted fashion.
Lookup with Default Connection Details
DB
Description: This function accepts a table name, keyvalue pairs and column names as arguments and does the lookup in the database and returns the result in sorted form.
Input: Table name, Key value pairs, Columns names.
Output: String containing the lookup result in sorted order.
Points to note
- DBLookup fetches the entries from a table and stores them in local cache the first time and it uses this cache to perform lookups for subsequent requests. This cache will not be updated at runtime again. Therefore it should preferably be used only for tables which are not updated once populated, that is for static data.
Lookup functions take key columns name value pairs as <column1>=<value1>,<column2>=<value2> etc.
For Example: dvSendDept=100,dvSendCode=BLK
- Lookup functions can return the values of multiple columns. To get multiple columns, use the format <column3>,<column4>. For Example: dvValueDA, dvDescription
- Dates are expected in MM/dd/yyyy HH:mm:ss format
Make sure the input value match the column length defined in the database. For example, if the dvSendCode is defined as char(10) in the database, the input value should be BLK followed by seven spaces.
Prerequisites
- For usage and testing in eMapper tool, add required database drivers in the eMapper classpath.
For example, if the lookup tables are in HSQL, include the path of hsqldb.jar in Test Classpath table in the Mapper Preferences page in eStudio.
- To use this function in the eMapper tool, a system property -Dmapper.lookup.dbconfig has to be defined in %FIORANO_HOME%/eStudio/eStudio.ini file and it should point to the path of db.properties file which contains the url, driverName, user and password. Sample db properties file is shown below which contains the data for oracle data base.
Figure 37: Sample db properties file
- For use in Route transformations, mapper.lookup.dbconfig property has to be set in {FIORANOHOME}/fps/bin/fps.conf.
- For use in XSLT component, mapper.lookup.dbconfig property has to be included in JVM_PARAMS For example: -Dmapper.lookup.dbconfig=<path of db.properties>
Lookup with Connection Details
DB
Description: This function accepts a table name, keyvalue pairs, column names, url, driver name, user name and password as arguments and does the lookup in the database and returns the result in sorted form.
Input: Table name, Key value pairs, Columns names, URL, driver name, user name and password.
Output: String containing the lookup result in sorted order.
Points to note
- DBLookup fetches the entries from a table and stores them in local cache the first time and it uses this cache to perform lookups for subsequent requests. This cache will not be updated at runtime again. Therefore it should preferably be used only for tables which are not updated once populated, that is for static data.
- Lookup functions take key columns name value pairs as <column1>=<value1>,<column2>=<value2> etc.
For example, dvSendDept=100, dvSendCode=BLK
Lookup functions can return value of multiple columns. To get multiple columns, use the format <column3>,<column4>.
For example, dvValueDA, dvDescription
- Dates are expected in MM/dd/yyyy HH:mm:ss format
- Make sure the input value match the column length defined in the database. For example, if the dvSendCode is defined as char(10) in the database, the input value should be BLK followed by 7 spaces.
Prerequisites
- Add required database drivers in the eMapper classpath.
For example, if the lookup tables are in HSQL, include the path of hsqldb.jar in Test Classpath table in the Mapper Preferences page in eStudio.
JMS Message Functions
The various functions in this category extract specific information from a JMS Message and output to the same. The input for these functions is a JMS Message. The following are the available JMS Message Functions:
- Byte Content
- Text Content
- Header
- Attachment
Byte Content
Function: Byte Content
Description: The Byte Content function returns the byte content of a Fiorano document.
Output: Base64 encoded string value
Text Content
Function: Text Content
Description: The Text Content function returns content which is in text format from a Fiorano document.
Output: String value
Header
Function: Header
Description: The Header function returns the value of the name that is passed as a property to the function.
Output: String value
Attachment
Function: Attachment
Description: The Attachment function returns any attachments attached to a Fiorano document. The name of the attachment needs to be passed as a property to the function.
Output: Base64 encoded string value
User-defined Functions
The various functions in this category are user defined and perform various functionalities. The following User Defined functions are available:
- dateConversion
- compute
- nextMillenium
- replace
myExt:dateConversion
Description: Converts the date from one format to the other. For example, date can be converted from MM-dd-yyyy to dd-MM–yy function convertDate (dateString, inFormat, outFormat)
Field | Full Form | Short Form |
Year | yyyy (4 digits) | yy (2 digits), y (2 or 4 digits) |
Month | MMM (name or abbr.) | MM (2 digits), M (1 or 2 digits) |
| NNN (abbr.) |
|
Day of Month | dd (2 digits) | d (1 or 2 digits) |
Day of Week | EE (name) | E (abbr) |
Hour (1-12) | hh (2 digits) | h (1 or 2 digits) |
Hour (0-23) | HH (2 digits) | H (1 or 2 digits) |
Hour (0-11) | KK (2 digits) | K (1 or 2 digits) |
Hour (1-24) | kk (2 digits) | k (1 or 2 digits) |
Minute | mm (2 digits) | m (1 or 2 digits) |
Second | ss (2 digits) | s (1 or 2 digits) |
AM/PM | a |
|
Input: Accepts three arguments. The first argument is the date passed as a string to the function. The second argument is the input format and the third argument is the required output format for the date.
Output: The date string
Examples:
MMM d, y matches: January 01, 2000, Dec 1, 1900, Nov 20, 00
M/d/yy matches: 01/20/00, 9/2/00
MMM dd, yyyy hh:mm:ssa matches: January 01, 2000 12:30:45AM
myExt: replace
Description: This user-defined function replaces parts of a string that match a regular expression with another string.
string regexp:replace(string, string, string, string)
Input: The function accepts four arguments. The first argument is the string to be matched and replaced. The second argument is a regular expression that follows the Javascript regular expression syntax. The fourth argument is the string to replace the matched parts of the string.
The third argument is a string consisting of character flags to be used by the match. If a character is present then that flag is true. The flags are:
- g: global replace - all occurrences of the regular expression in the string are replaced. If this character is not present, then only the first occurrence of the regular expression is replaced.
- i: case insensitive - the regular expression is treated as case insensitive. If this character is not present, then the regular expression is case sensitive.
Output: String
myExt:compute
Description: This user-defined function can be used to compute all mathematical operations such as Addition, Subtraction, Multiplication and division of numbers. The function does not compute mathematical operations such as cos, sin, etc.
Input: A valid javascript expression
Output: A number
myExt: nextMillenium
Description: This user-defined function returns the number of days in the next millenium.
Input: There is no input for this function
Output: Number