This gives an overview of what mapping functions that are currently supported. You can use these functions from within mapping xpath rules and mapping conditions.
Important Note: If you pass an array directly on root level, you can access its array elements by
array[index]
Extracts a value by evaluating an xpath expression with a given context object:
xpath:eval(String xpathExpression, this)
Extracts the english greeting from a list of all greetings and checks if the value matches 'hello':
xpath:eval("greetings[@lang = 'english']",this) == "hello"
Decodes a base64 String to a byte array
vorto_base64:decodeString(String value)
Decodes a base64 byte array to a byte array
vorto_base64:decodeByteArray(byte[] value)
Checks if the given expression is null or empty string
empty(person.name)
Checks if the given expression is not null or not empty
empty(person.name)
For more functions, please visit Apache JEXL Reference
Gets a substring from the specified String avoiding exceptions.
Gets a substring from the specified String avoiding exceptions.
Data: {"voltage : "2323mV"}
Example Mapping that extracts 2323
:
vorto_string:substring(voltage,0, string:length(voltage)-2)
Removes control characters (char <= 32) from both ends of this String
For more string functions, visit Complete API Documentation
Converts an array of byte into an int using the default (little endian, Lsb0) byte and bit ordering:
vorto_conversion1:byteArrayToInt(byte[] src, int srcPos, int dstInit, int dstPos, int nBytes)
Example data: {"data : [0, 0, 0, -48, 7, 0]}
Example Mapping:
vorto_conversion:byteArrayToInt(/data, 3, 0, 0, 3)
For more conversion functions, visit Complete API Documentation
Converts a string value to a float:
number:toFloat(String value)
For more number functions, visit Complete API Documentation
Formats the given long value to a date string of form 'yyyy-MM-dd HH:mm:ssZ'
vorto_date:format(long value)
Formats the given long value to a date string with the given format:
vorto_date:format(long value, String pattern)
Converts the given double value to a string:
type:convertDouble(double value)
Converts the given integer value to a string
type:convertInt(int value)
Converts the given string to a boolean:
boolean:toBoolean(String str)
For more boolean functions, see Complete API Documentation
Converts the hex string argument into an array of bytes:
vorto_conversion2:parseHexBinary(String str)
For more converter2 functions, visit Complete API Documentation
Converts a "short" value between endian systems
vorto_endian:swapShort(short value)
Converts a "float" value between endian systems
vorto_endian:swapFloat(float value)
For more endian functions, visit Complete API Documentation