A helper function is an object literal containing references to decimal, date, and dateTime operators. It has the following syntax:
helper = { 'decimal': <all decimal operators>, 'dateTime': <all dateTime operators>, 'date': <all date operators> }

The list of operators is identical to list in the Corticon.js Studio operator tree.

Note: The list of operators is nearly identical to the one listed in the studio operator tree. See DateTime and Decimal .

The lists of helper functions are documented in the Studio's Rule Operator view. Exceptions are distinguished at the bottom of each list.

Decimal helper functions

The helper Decimal functions are as follows:

  • multiply
  • divide
  • negated
  • exponent
  • add
  • minus
  • absVal
  • floor
  • ceiling
  • ln
  • log
  • logBase
  • lessThan
  • lessThanOrEqual
  • equal
  • different
  • greaterThan
  • greaterThanOrEqual
  • min
  • max
  • random
  • toString
  • toInteger
  • round

Exceptions:

  • isDecimal returns a boolean true if the object is a Decimal else returns false
  • constructDecimal returns a Decimal object. It accepts number or strings as parameter. For example, constructDecimal(10.5) or constructDecimal("100000000000000000000000.56789")
  • outputToJson returns a string representation suitable for inclusion in a JSON payload.

DateTime helper functions

The helper DateTime functions are as follows:

  • lessThan
  • lessThanOrEqual
  • equal
  • different
  • greaterThan
  • greaterThanOrEqual
  • addYears
  • addMonths
  • addDays
  • addHours
  • addMinutes
  • addSeconds
  • yearsBetween
  • monthsBetween
  • weeksBetween
  • daysBetween
  • hoursBetween
  • minutesBetween
  • secondsBetween
  • year
  • month
  • day
  • hour
  • min
  • sec
  • now
  • dayOfWeek
  • dayOfYear
  • getMilliseconds
  • weekOfMonth
  • weekOfYear
  • afterDate
  • beforeDate
  • isSameDate
  • afterTime
  • beforeTime
  • isSameTime

Exceptions:

  • constructDateTime create a DateTime object. It accepts either a string which has to be an ISO-8601 representation of a DateTime or a long value which represents the time since epoch in milliseconds.
  • isDateTime returns a boolean true if the object is a DateTime else returns false
  • outputToJson returns a string representation in ISO-8601 format as UTC. The string is suitable for inclusion in a JSON payload.

Date helper functions

The helper Date functions are as follows:

  • lessThan
  • lessThanOrEqual
  • equal
  • different
  • greaterThan
  • greaterThanOrEqual
  • addYears
  • addMonths
  • addDays
  • addHours
  • addMinutes
  • addSeconds
  • yearsBetween
  • monthsBetween
  • weeksBetween
  • daysBetween
  • hoursBetween
  • minutesBetween
  • secondsBetween
  • year
  • month
  • day
  • hour
  • min
  • sec
  • now
  • toDate
  • dayOfWeek
  • dayOfYear
  • getMilliseconds
  • weekOfMonth
  • weekOfYear
  • afterDate
  • beforeDate
  • isSameDate
  • afterTime
  • beforeTime
  • isSameTime

Exceptions:

  • constructDate create a Date object. It accepts either a string which has to be an ISO-8601 representation of a Date or a long value which represents the time since epoch in milliseconds.
  • isDate returns a boolean true if the object is a Date else returns false
  • outputToJson returns a string representation in ISO-8601 format as UTC. The string is suitable for inclusion in a JSON payload.