Why you should - Limit Activity rules?
When you started learning pega for the first time, why most of the mentors don't say about the concepts related to activities? When you start building your application, why architects says to eliminate activity rules and go with other rule types instead? Why does pega shows guardrail warning when you create an activity?
As a pega developer, when ever we started thinking of a use case, our minds automatically think about writing an activity as a first option. As the activity provides lot of options and its look like a algorithm or program that we are comfortable with. But why pega suggests to limit the activity usage, what happens if we create an activity rule. Most of us have this kind of similar question in our minds. Lets us go back to the basics and understand the real reason behind all of this.
What are activities?
Activity rules are most like traditional computer programs, in that they consist of a sequence of steps that are typically performed in order. Activity contains series of steps and each step contains a operation known as a method. For example, an activity can fetch a work item from the database, compute new values for some of the properties in the work item, and save the updated work item back into the database. An activity rule can perform computations, create, update, or delete objects, or support user interactions.
Most activities contain no more than 20 steps. Activities work in sequence order or can jump ahead to a later-numbered step, identified by a label, based on a conditional test.
contain a sequence of procedural, atomic steps that are by default executed top down
reference a specific instruction (known as a method) in each step
can perform calculations
can retrieve, update and save data
can call other activities
can contain loops or iterations
Problems with Activities
1. Prone to security
As we can write java steps or java script inside the activities, these are prone to many security attacks. Java code has to be properly written
to prevent our application from many security attacks like Injection and Cross-site scripting.
You may also want to see: