Supported expression functions

The expression functions described here are supported and handled by the Monitor Server in WebSphere® Business Monitor.

The following tables list all expression functions that can be used in the modeled business measures model and that are handled by the Monitor Server to calculate the values of the metrics and KPIs that will be displayed in the dashboards. The tables also list the output behavior of each data-type variation of the function’s argument list.

absolute-value (com.ibm.btools.expression.absoluteValue)

Argument list: Long

Variations Output
A long value The absolute value of this long value

Argument list: Double

Variations Output
A double value The absolute value of this double value
Double.POSITIVE_INFINITY (*)Double.POSITIVE_INFINITY
Double.NEGATIVE_INFINITY (*)Double.POSITIVE_INFINITY
Double.NaN (*)Double.NaN

integer-part (com.ibm.btools.expression.integerValue)

Argument list: Double

Variations Output
A double value The integer cast value of the double value
Double.NaN 0
Double.MAX_VALUE Integer.MAX_VALUE
Double.MIN_VALUE 0
Double.NEGATIVE_INFINITY Integer.MIN_VALUE
Double.POSITIVE_INFINITY Integer.MAX_VALUE

decimal-part (com.ibm.btools.expression.fractionalValue)

Argument list: Double

Variations Output
A double value The fractional part of the double value
Double.NaN (*)Double.NaN
Double.NEGATIVE_INFINITY (*)Double.NEGATIVE_INFINITY
Double.POSITIVE_INFINITY (*)Double.POSITIVE_INFINITY

if-then-else (com.ibm.btools.expression.ifthenelse)

Argument list: bBoolean: test, String: thenTerm, String: elseTerm

Variations Output
Boolean, String, String If test is true, thenTerm is returned; otherwise, elseTerm is returned.

Argument list: boolean: test, double: thenTerm, double: elseTerm

Variations Output
Boolean, double, double If test is true, thenTerm is returned; otherwise, elseTerm is returned.

Argument list: boolean: test, boolean: thenTerm, boolean: elseTerm

Variations Output
Boolean, boolean, boolean If test is true, thenTerm is returned; otherwise, elseTerm is returned.

attribute-is-set (com.ibm.btools.expression.bom.ome.isSet)

Argument list: EventWrapper: cbe, String: propertyName

Variations Output
EventWrapper, String Verifies whether the given property is found in the CBE, and if found, whether it is set. This method will not return true unless the property is found and set in the CBE. The user must check whether a property is set. It can have an alternative path if it is not set by using the if-then-else function. A property used in an expression and not set in an event causes the Monitor Server to throw a hard exception and to be suspended.

greater-value (com.ibm.btools.expression.maxValue)

Argument list: long: var1, long: var2

Variations Output
long, long Returns the maximum value.

Argument list: double: var1, double: var2

Variations Output
double, double Returns the maximum value.

Double.NaN, double

Or

double, Double.NaN

(*)Returns Double.NaN

Double.POSITIVE_INFINITY, double

Or

double, Double.POSITIVE_INFINITY

(*)Returns Double.POSITIVE_INFINITY
Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY (*)Returns Double.NEGATIVE_INFINITY

Double.NEGATIVE_INFINITY, double

Or

double, Double.NEGATIVE_INFINITY

Returns the other double value.

Argument list: Double: var1, long: var2

Variations Output
double, long Returns the maximum value.
Double.POSITIVE_INFINITY, long (*)Double.POSITIVE_INFINITY
Double.NaN, long (*)Double.NaN
Double.NEGATIVE_INFINITY, Long.MAX_VALUE ( (double) Long.MAX_VALUE )
Double.NEGATIVE_INFINITY, Long.MIN_VALUE ( (double) Long.MIN_VALUE )

Argument list: long: var1, double: var2

Variations Output
long, double Returns the maximum value.
long, Double.POSITIVE_INFINITY (*)Double.POSITIVE_INFINITY
long, Double.NaN (*)Double.NaN
Long.MAX_VALUE, Double.NEGATIVE_INFINITY ((double) Long.MAX_VALUE)
Long.MIN_VALUE, Double.NEGATIVE_INFINITY ((double) Long.MIN_VALUE)

lesser-value (com.ibm.btools.expression.minValue)

Argument list: long: var1, long: var2

Variations Output
long, long Returns the minimum value.

Argument list: double: var1, double: var2

Variations Output
double, double Returns the maximum value.

Double.NaN, double

Or

double, Double.NaN

(*)Returns Double.NaN

Double.NEGATIVE_INFINITY, double

Or

double, Double.NEGATIVE_INFINITY

(*)Returns Double.NEGATIVE_INFINITY
Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY (*)Returns Double.POSITIVE_INFINITY

Argument list: Double: var1, long: var2

Variations Output
Double.MIN_VALUE, Long.MIN_VALUE ( (double) Long.MIN_VALUE )
Double.MAX_VALUE, Long.MAX_VALUE ( (double) Long.MAX_VALUE )
Double.NaN, long (*)Double.NaN
Double.NEGATIVE_INFINITY, long (*)Double.NEGATIVE_INFINITY
Double.POSITIVE_INFINITY, long (double) long

Argument list: long: var1, double: var2

Variations Output
Double.MIN_VALUE, Long.MIN_VALUE ( (double) Long.MIN_VALUE )
Double.MAX_VALUE, Long.MAX_VALUE ( (double) Long.MAX_VALUE )
Double.NaN, long (*)Double.NaN
Double.NEGATIVE_INFINITY, long (*)Double.NEGATIVE_INFINITY
Double.POSITIVE_INFINITY, long (double) long

includes-specified-text (com.ibm.btools.expression.containsText)

Argument list: String: text, String: subText

Variations Output
String, String Looks up subText in the text and returns true if subText is contained in the text; otherwise, it returns false.

"", String

Or

String, ""

false

null, String

Or

String, null

Throws NullPointerException

starts-with-specified-text (com.ibm.btools.expression.startsWithText)

Argument list:String: text, String: subText

Variations Output
String, String If text starts with subText, true is returned; otherwise, false is returned.
"", String false
String, "" true

null, String

Or

String, null

Throws NullPointerException

to-uppercase (com.ibm.btools.expression.toUpperCase)

Argument list:String: text

Variations Output
String Returns text in uppercase letters.
"" ""
null Throws NullPointerException

to-lowercase (com.ibm.btools.expression.toLowerCase)

Argument list:String: text

Variations Output
String Returns text in lowercase letters.
"" ""
null Throws NullPointerException

Concatenate (com.ibm.btools.expression.concat )

Argument list:String: s1, String: s2

Variations Output
String, String Returns s1 + s2
null, String "null" + s2
String, null s1 + "null"
null, null "nullnull"
"", String s2
String, "" s1

current-event-creation-time (com.ibm.btools.expression.currentTime)

Argument list:EventWrapper: currentEvent

Variations Output
EventWrapper Returns the creation time of the event in milliseconds.

current-event-creation-date (com.ibm.btools.expression.currentTime)

Argument list:EventWrapper: currentEvent

Variations Output
EventWrapper Returns the creation date of the event in milliseconds.

current-event-creation-datetime (com.ibm.btools.expression.currentTime)

Argument list:EventWrapper: currentEvent

Variations Output
EventWrapper Returns the creation date-time of the event in milliseconds.

Add-To-String-List (com.ibm.btools.expression.bom.ome.addToList)

Argument list:String: list, String: addedItem, Boolean: duplicate

Variations Output
String, String, boolean An element is added to a comma-separated list. If duplicate is true, duplicates are accepted inside the list; otherwise, the list does not accept duplicates.
String, "", (false or true) The list with a trailing comma, for example, "hhh,kkk,"
"", element, (false or true) A string containing an element
"", "",(false or true) "", empty string
null, String, (false or true) A string containing an element
String, null, (false or true) Throws NullPointerException

Remove-From-String-List (com.ibm.btools.expression.bom.ome.removeFromList.string)

Argument list:String: list, String: removedItem, boolean: allOccurences

Variations Output
String, String, boolean Removes an element from a comma-separated list.An option is given whether to remove all occurrences inside the list.
null, String, (false or true) ""
"", String, (false or true) ""
String, "", (false or true) String of the list
String, null, (false or true) Throws NullPointerException

number-to-text (com.ibm.btools.expression.bom.ome.numberToString)

Argument list:double: number

Variations Output
Double Returns the string of the given number.
Double.POSITIVE_INFINITY Infinity
Double.NEGATIVE_INFINITY -Infinity
Double.NaN NaN

date-to-datetime (com.ibm.btools.expression.bom.ome.dateToDateTime)

Argument list:long: date

Variations Output
long Converts the given date to date-time

datetime-to-date (com.ibm.btools.expression.bom.ome.dateTimeToDate)

Argument list:long: date

Variations Output
long The date time will be truncated to remove the date. The truncated date is then changed into milliseconds.

datetime-to-time (com.ibm.btools.expression.dateTimeToTime)

Argument list:long: date

Variations Output
long Converts the given date-time to time. It sets the value of the date to zero, and the time is represented in milliseconds.

text-to-integer (com.ibm.btools.expression.bom.ome.textToInteger)

Argument list:String: string

Variations Output
String Returns the integer value of the given string text.
An unformatted string Throws NumberFormatException
null Throws NullPointerException

text-to-number (com.ibm.btools.expression.bom.ome.stringToNumber)

Argument list:String: string

Variations Output
String Returns the number found in the string in the form of double.
An unformatted string Throws NumberFormatException
null Throws NullPointerException

text-to-date (com.ibm.btools.expression.bom.ome.stringToDate)

Argument list:String: string, String: format

Variations Output
String, String Formats the given string into a date format. Because the date format in the system is represented as long, this method returns long.

String, null

Or

null, String

Throws NullPointerException

String, ""

Or

"", ""

Or

"", String

Throws ParseException

text-to-time (com.ibm.btools.expression.bom.ome.stringToTime)

Argument list:String: string, String: format

Variations Output
String, String Formats the given string into a date format; because the date format in the system is represented as long, this method returns long.

String, null

Or

null, String

Throws NullPointerException

String, ""

Or

"", ""

Or

"", String

Throws ParseException
Important: This function may cause an IllegalArgumentException. For modelling metrics that are populated from the event, use the text-to-datetime function instead.

text-to-datetime (com.ibm.btools.expression.bom.ome.stringToDateTime)

Argument list:String: string, String: format

Variations Output
String, String Formats the given string into a date format; because the date format in the system is represented as long, this method returns long.

String, null

Or

null, String

Throws NullPointerException

String, ""

Or

"", ""

Or

"", String

Throws ParseException

text-to-duration (com.ibm.btools.expression.stringToDuration)

Argument list:String: string, String: format

Variations Output
String, String Formats the given string into a duration format. Because the duration format in the system is represented as long, this method returns long. The format must be dddd-hh-mm-ss; if any other format, a NoSuchElementException israised.
"", String Throws NoSuchElementException
null, String Throws NullPointerException

Copyright IBM Corporation 2005. All Rights Reserved.