Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Function rules in offline mode

Updated on November 9, 2021

You use function rules in online-only applications to define Java methods that run when a function rule is processed. When you develop an application that users can access with an offline-enabled mobile app, the mobile app uses JavaScript-based equivalents of Java-based utility function rules, provided that such equivalents exist.

The function rule logic of JavaScript is equivalent to the logic of the Java version of the utility function rule. However, not all functions that are available in Java are available by default in JavaScript.

Supported JavaScript functions in offline mode

Offline-enabled mobile apps support a specific set of JavaScript functions that are equivalent to predefined Java utility functions.

The following table lists the JavaScript functions that are supported in offline-enabled mobile apps, along with the corresponding libraries.
Library nameJavaScript text file ruleSupported functions
DateTimepzpega_functions_DateTimeLibrary
  • CompareDates
  • CompareDates__String_String_boolean
  • isDateInThePast
  • pxDateTimeisPastOrFuture
  • isWithinDaysOfNow
  • compareDatesByDays
  • currentDateTime
  • getCurrentDateStamp
  • getCurrentTimeOfDayOnlyStamp
  • getCurrentTimeOfDayStamp
  • getCurrentTimeStamp
  • millisecond__BigDecimal
  • minute
  • minute__BigDecimal
  • month
  • month__BigDecimal
  • dateValue
  • day
  • day__BigDecimal
  • FormatElapsedTime
  • FormatElapsedTimeFromProperty
  • date
  • dateStringToBigDecimal
  • dateTimeToBigDecimal
  • DateTimeDifference
  • DateTimeDuration
  • pxIsDefaultDateTime__BigDecimal
  • second
  • second__BigDecimal
  • year
  • weekday
  • TimeDifference
  • parseDateString
  • addCalendar
  • addToDate
  • CompareDateTimeStamp
  • CurrentDateTime
  • GetDate
  • getTimeStampAsDateStamp
  • hour
  • hour__BigDecimal
Defaultpzpega_functions_DefaultLibrary
  • isInThePast
ExpressionEvaluatorspzpega_functions_ExpressionEvaluatorsLibrary
  • compareTwoDateTimes
  • compareTwoNumbers
  • compareTwoStrings
  • compareTwoValues
  • CompareToBoolean
  • sum
  • abs
  • sqr
  • round
  • evaluateWhen
Mathpzpega_functions_MathLibrary
  • greaterThan
  • greaterThanEqualTo
  • lessThanEqualTo
  • lessThan
  • BoundInteger
  • Sqrt
  • Exp
  • Log
  • Square
  • equals
  • notEqual
  • divide
  • divideWithScale
  • _divideWithScale
Sortpzpega_functions_SortLibrary
  • nullCheck
  • classicComparsion
  • compareStrings
  • defaultCompareStrings
  • defaultCompareDates
  • defaultCompareDecimals
  • defaultCompareNumbers
  • defaultCompareTimes
  • defaultCompareBooleans
  • isNumeric
  • compareWorkIDs
Stringpzpega_functions_StringLibrary
  • notEqualsIgnoreCase
  • equalsIgnoreCase
  • contains
  • equals
  • startsWith
  • endsWith
  • replaceAll
  • stripCharsOffEnd
  • stripNonAlphabeticChars
  • substring
  • substring__String_int
  • escapeWithMap
  • escapeAsHTML
  • escapeForXSL
  • indexOf
  • inString
  • trim
  • TrimNumber
  • truncateLongText
  • whatComesAfterFirst
  • whatComesAfterLast
  • whatComesBeforeFirst
  • whatComesBeforeLast
  • isAlphaNumeric
  • isDouble
  • isInteger
  • isLiteral
  • length
  • notEquals
  • toLowerCase
  • toUpperCase
  • toDecimal
  • _removeThousandSeparator
  • toDate
  • _getDateWithoutTime
  • toDateTime
  • _roundNumber
  • pxIsInGRSFormat__String
  • pxReplaceAllViaRegex
  • pzFullfillTab
  • pzGetFirstCharacterFromEachWord__String_boolean
  • pzSplit
Utilitiespzpega_functions_UtilitiesLibrary
  • IsInPageList
  • LengthOfPageList

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us