Developing Apama Applications > Developing Apama Applications in Event Modeler > Using Functions in Event Modeler > Reference information for provided functions > Miscellaneous functions
Miscellaneous functions
The following table describes the miscellaneous functions.
Miscellaneous functions
Function name
Return value
Parameters
Description
ABS
number
number value
Returns the absolute value of the number supplied.
ADD_EXTRAPARAM
text
text payload,
textfieldname,
textvalue
Takes an existing extraParam value and adds the specified field and value to it.
CEIL
number (whole number)
number value
Returns the ceiling integer value of the number passed. This is the smallest possible integer that is larger than the value supplied.
CONCAT
text
text prefix,
text suffix
Concatenates two strings and returns the result as a string.
CONCAT
text
text prefix,
choice suffix
Concatenates an enumeration value to a string, and returns the result as a string.
CONCAT
text
text prefix,
number suffix
Concatenates a number to a string, and returns a string.
CONDITIONAL
text
condition condition
text true_result
text false_result
Functions like an IF statement. The first parameter is the expression to be evaluated, similar to a condition in an IF statement. The second and third parameters are the values to return according to the result of the condition. The second parameter represents a true result. The third parameter represents a false result. See Example of CONDITIONAL function.
FLOOR
number (whole number)
number value
Returns the floor integer value of the number passed. This is the largest possible integer that is smaller than the value supplied.
GET_EXTRAPARAM
text
text payload,
text fieldname
Returns the value from extraParam data of the specified field, else an empty string.
HAS_EXTRAPARAM
boolean
text payload,
text fieldname
Returns true if the extraParam data has the specified field value.
ISFINITE
boolean
float value
Returns true if value is finite, that is, it is not infinite or NaN.
ISINFINITE
boolean
float value
Returns true if value is infinite, that is, it is positive or negative infinity.
ISNAN
boolean
float value
Returns true if value is NaN, that is, it is not a number.
MAX
number
number value1,
number value2
Returns the largest of two numbers.
MIN
number
number value1,
number value2
Returns the smallest of two numbers.
POW
number
number value,
number exponent
Returns the value of the first parameter to the power of the second parameter.
REPLACE
text
text value,
text old,
text new
Replaces all string occurrences of old in value with new.
RND
number
number lower bound,
number upper bound
Returns a random number between the specified boundaries.
ROOT
number
number value,
number exponent
Returns the value of the first parameter root of the second parameter.
ROUND
number
number value,
number decimal_places
Rounds a float to a given number of decimal places. You can specify a negative number for decimal_places to round in the opposite direction. See Example of ROUND function.
TO_BOOLEAN
condition
text value
Converts a string to a Boolean value, and returns the Boolean value. This function is case insensitive.
TO_NUMBER
number
choice value
Converts an enumeration to a number, and returns the number.
TO_NUMBER
number
text value
Converts a string to a number, and returns the number.
TO_TEXT
text
condition value
Converts a Boolean value to a string, and returns the string.
TO_TEXT
text
number value
Converts a number to a string, and returns the string.
Example of CONDITIONAL function
side = CONDITIONAL (price is greater than 50, "BUY", "SELL")
If the price is greater than 50, this function returns "BUY". The side Scenario variable is set to BUY or SELL according to whether the price variable is greater than 50.
Example of ROUND function
You can specify a negative number to round in the opposite direction. For example:
Value
Decimal places
Result
12345.6543
4
12345.6543
12345.6543
3
12345.654
12345.6543
2
12345.65
12345.6543
1
12345.7
12345.6543
0
12346.0
12345.6543
-1
12350.0
12345.6543
-2
12300.0
12345.6543
-3
12000.0
12345.6543
-4
10000.0
12345.6543
-5
0.0
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.