Activities, libraries, and functions

Activities are the primary processing rules in Pega Platform. Each activity is a rule, saved as an instance of the Rule-Obj-Activity rule type. Pega Platform includes hundreds of useful standard activities that your application can call. Developers create and debug additional custom activities.

As an activity executes, it can create or remove clipboard pages, create, and update properties on these pages, save them to the PegaRULES database, and interact with a human user by sending and receiving HTML documents and forms.

Steps

Activities process a sequence of steps. Each step can contain:

  • A method and its parameters — one of the dozens of built-in basic operations that perform computations, update properties and other aspects of the clipboard, or move data between memory and the database.
  • Flow-of-control instructions, including calls or branches to other activities.
  • Inline Java — a short snippet of Java code. Often, this code calls a function ( Rule-Utility-Function rule type). Functions are grouped into libraries ( Rule-Utility-Library rule type).

Calling activities

Activities can be called from many places:

Rules assembly

When you save an Activity rule form, the system converts the activity into Java code. You can review the resulting Java source code, but not alter this code. You can also generate an English-language description (known as the verbalization ) of the activities processing, in the form of a text only HTML page that can become a part of your application's documentation.

Libraries and Functions

A library is a collection of Java functions that share a common name prefix, prerequisite Java packages, and other initial conditions. A library is an instance of the Rule-Utility-Library class. A function rule encapsulates a Java function and makes it accessible to Pega Platform developers as a rule. A function is an instance of the Rule-Utility-Function class.

Debugging

Three tools support developers as they work with activities:

  • The Clipboard tool lets developers examine and alter the contents of their clipboard.
  • The Tracer tool provides powerful, detailed debugging for activities, even when run by others or in background.
  • The Performance tool provides comprehensive statistics about resources consumed by a requestor, and system response.