In Pega Platform™, activities automate processing. You create activities in Dev Studio with steps that run in the order you specify. Activity rules automate the system to support complex processes, elaborate calculations, or when a rule requires an activity in order to run. As a best practice, check to see if an Out-of-the-Box (OOTB) process exists as custom activities can make it more difficult to maintain your application.
Activities might be appropriate for the following processes:
- Background processing
- Complex loops
- Declare OnChange
- Parallel processing
- Recurring scheduled events
For instance, a Declare OnChange requires using an activity to run a process or suspend work when the value of a specified property changes. After the activity finishes, control returns to the rule that called the activity.
In another example, an insurance company needs to upload submitted insurance claims to the Division of Motor Vehicles. Automated uploads occur at off-peak hours to minimize the impact on users. In Pega Platform, you can configure an activity to automate claim uploads without user intervention.
Activities versus Data transforms
While Activities may appear like Data Transforms on steroids, the pragmatic reality is quite the opposite. See the comparison below:
General "do anything" purpose
Specialized data transformation rule
allows for all-in-one conglomerates of actions
pushes developer to split the logic
introduces the ease of access to various low-level technical operations
pushes developers to use dedicated rules, e.g. Data Pages for connections & reports, a multitude of out-of-the-box functions, etc.
introduces risks for maintenance and updates
adherence to the principle of Separation of Concerns
the only rule in Pega that allows for a seamless super class call
As you can see, Activities are a very convenient solution for developers, that like a "poisoned apple" may bring a lot of maintenance issues. So the rule of thumb is to use Data Transforms and other specialized rules, unless you can't, and only then considering Activities.
Automations and Activities
Automations are OOTB rules that you can configure as steps in the Case Designer and as utilities in flows to perform specific tasks, such as moving a case to the next stage or saving case attachments to a document repository. Automations can include standard activities. You can open an automation rule to view its inputs and outputs. You can also use automations in an activity, using the Call-Automation method.
Check your knowledge with the following interaction: