Activities in Pega: Core Elements for Procedural Logic

 Activity in Pega 

Activity in Pega is a fundamental building block defining procedural logic within the Pega platform. Activities automate tasks, process data, and, furthermore, control workflow in Pega applications.  Here is an overview of activities in Pega, and an example to illustrate their use.

Key Concepts of Activities in Pega

Purpose: Activities are used to perform a sequence of steps that can include calculations, data manipulations, decision-making, calling other rules or activities, and, moreover, much more.

Structure: Each step is defined with a method (e.g., Property-Set, Obj-Open, Call, etc.), parameters, and conditions.

 Activity in Pega 
Activity in Pega

Methods: Pega provides various predefined methods for activities, such as.

Property-Set: Assigns values to properties.
Obj-Open: Opens an instance of a class.
Obj-Save: Saves an instance of a class.
Call: Invokes another activity.

Parameters: You can, therefore, make activities reusable across different parts of the application by passing data in and out through parameters.

Security: Access to activities can be controlled through privileges and when rules.

Activity is a rule which is used to implement business logic.

It can be created under the “technical category”.

The implementation of our business logic can be done by using OOTB methods.

Method: Predefined business logic written in Java code is already stored within methods.

  • The “Method Dropdown” in an activity rule offers a variety of methods in PRPC.
  • We need to understand the purpose of each method to effectively utilize them within activity rule forms.
  • Activities are built by chaining together a series of steps, where each step calls a specific method. For optimal performance, however, it’s recommended to limit the number of steps per activity to 28.
  • If you exceed 28 steps, create multiple activities and call them together within a single activity.
  • Activities can call each other using the following instructions.

This version emphasizes the actions taken and clarifies who or what performs those actions.

  1. call                       2. Branch                   3. Queue

Under the security tab we can see the so many types of the Activity type.

  1. Activity
  2. Assembler
  3. Assign
  4. Asynchronous
  5. Load data
  6. Notify
  7. On change
  8. Rout
  9. Rule connect
  10. Trigger
  11. Utility
  12. Validate

Using an activity  we can do many things

  1. Create Pages on clipboard
  2. Assign values to properties
  3. Call other activities
  4. Call DB Tables and pass Queries.
  5. Call Other  Application by using web service protocols etc…

Below are basic Methods

  1. Page -New -> To create User pages on clipboard.
  2. Property-set ->Perform assignment operations.
  3. Page -Remove -> To delete pages from clipboard.

Example: Creating an activity, to create a page referring vehicle  class and set the property values.

Go to pages and classes tab and define the pages that we wanted to create or access.

Come back to the steps tab

Select the method and step page.

Add one more step & Click on expand icon.

Save. Now run the activity and see the results on clipboard.

Click on run button

Now , execution is completed.

To see the results go to clipboard.

Beside thread Select Standard

Now we can see page 1 click on that

Done.

Here Other than user properties, we can see one more OOTB property

pxObjClass : This property hold the reference class name of page.

FYI…….

When we directly run the activity, activity data will not be getting stored into back end.

Conclusion

Activity in Pega are, therefore, powerful tools for defining procedural logic and automating tasks. Firstly, they perform calculations. Additionally, they manipulate data. Furthermore, they make decisions. Moreover, activities can call other rules, enhancing versatility. Also, predefined methods like Property-Set simplify logic. Besides, activities accept parameters, promoting reuse. For example, an activity can update and save a customer record. Moreover, they integrate with data transforms. For instance, you can map data before processing. Similarly, decision tables enable data-driven choices.  They provide a structured way to perform complex operations, manipulate data, and, moreover, control workflow.  Understanding how to create and use activities is, therefore, essential for developing robust Pega applications. If you need further details on more advanced usage of activities or specific examples, feel free to ask.

Data Types in Pega

 

 

 

1 thought on “Activities in Pega: Core Elements for Procedural Logic”

Leave a Comment