Question
Aaseya IT Services Pvt. Ltd.
IN
Last activity: 16 Apr 2021 16:43 EDT
Why does Pega say Data transform is faster than activity
Why does Pega say Data transform is faster than activity as both generate and compile the java code in the backend. What is the main difference?
Can someone help me with a detailed explanation on this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 1 Feb 2021 2:01 EST
GovCIO
US
@SantoshAnisetty - Can you check this article:https://collaborate.pega.com/question/activity-vs-data-transforms ?
Pegasystems Inc.
IN
Use Data Transforms when
- Setting properties
- Iterating over page lists / page groups
- Synchronously referencing Data Pages
- Calling Functions
- Calling Data Transforms
Use Activities when...
- Calling other Activities
- Iterating over value lists / value groups
- Asynchronously referencing Data Pages
- Implementing Services
- Implementing Background processing
- Implementing Declare Trigger rules
- Implementing Declare OnChange rules
- Implementing Data Page post-load processing
- General orchestration of procedural processing
An Activity is something different where of course you can call Property-Set method or call DataTransform as well but you do many other things. Like showing harnesses, calling service rules etc. Activity also provides a way to execute Java code directly, that DT does not. Activities are harder to maintain and not as easy to construct as other rules in Pega. We should not use an activity for calculations or property validations that we can implement as constraints rules or Declare Expression rules. Use of a declarative rule (rather than an activity) eliminates the need to control how and when an activity executes. A best practice is to use declarative processing rather than activities when feasible.
Use Data Transforms when
- Setting properties
- Iterating over page lists / page groups
- Synchronously referencing Data Pages
- Calling Functions
- Calling Data Transforms
Use Activities when...
- Calling other Activities
- Iterating over value lists / value groups
- Asynchronously referencing Data Pages
- Implementing Services
- Implementing Background processing
- Implementing Declare Trigger rules
- Implementing Declare OnChange rules
- Implementing Data Page post-load processing
- General orchestration of procedural processing
An Activity is something different where of course you can call Property-Set method or call DataTransform as well but you do many other things. Like showing harnesses, calling service rules etc. Activity also provides a way to execute Java code directly, that DT does not. Activities are harder to maintain and not as easy to construct as other rules in Pega. We should not use an activity for calculations or property validations that we can implement as constraints rules or Declare Expression rules. Use of a declarative rule (rather than an activity) eliminates the need to control how and when an activity executes. A best practice is to use declarative processing rather than activities when feasible.
A data transform rule provides a purpose-built rule for easily transforming and mapping clipboard data without using activities. In general, the data transform defines how target data (properties, pages, etc) is mapped from and transformed by source data (properties, pages, etc). I would say the DataTransform is a bit like a Property-Set method in an Activity. Mainly used to set values on clipboard pages for example. For data manipulations, we can use a Data Transform instead of an activity.
While they share much helper code, e.g. for the generation of property sets and When conditionals, the two assemblers have very different implementations. This difference was primarily necessitated by Data Transform's "dual step page" model.
Regards,
Tashika
-
Santosh Anisetty C Shaik Muzammil
Updated: 1 Feb 2021 4:06 EST
Optum
IN
Great response, I have a question here why are we even showing warnings, compliance score issues when we use activities for the below use case where we end up using activities as you mentioned ?
Use Activities when...
- Calling other Activities
- Iterating over value lists / value groups
- Asynchronously referencing Data Pages
- Implementing Services
- Implementing Background processing
- Implementing Declare Trigger rules
- Implementing Declare OnChange rules
- Implementing Data Page post-load processing
- General orchestration of procedural processing
-
VAMSHI MANI TEJA ELLENKI
Aaseya IT Services Pvt. Ltd.
IN
@shret Could you please elaborate this point (Activities are harder to maintain and not as easy to construct as other rules). How does it make it harder to construct over other rule types?
-
Yamuna Paruchuri
Pegasystems Inc.
IN
Activities are harder to maintain because we can add Java step which itself might be poor performing, difficult to maintain, or simply used for debugging.
But I feel it's not recommended due to multiple reasons, foremost being maintainability and upgrade. Pega takes care of the changed logic in Engine, Integration or any other layer of the application while upgrading environment to latest Pega version. And Pega's main objective is agility with less coding rather providing OOTB feature for implementing most of the business requirement.
DSLs are small, expressive programming languages custom designed for specific tasks, like BPM and progressing towards complete CRM with SaaS for non-programmer as well. Another reason is security, which I don't have much idea but Java code is less promoted it being a reason as well.
You can check this - https://community.pega.com/knowledgebase/articles/guardrail-4-avoiding-java-steps-activities
Regards,
Tashika
-
Santosh Anisetty
Aaseya IT Services Pvt. Ltd.
IN
@shret Thanks for a lot
Pegasystems Inc.
US
@SantoshCLSA The answer to this question is because Activities and Data Transforms are actually generated and executed differently. In the last couple years, the back-end of Data Transforms along with a few other rules have been rewritten to generate and execute much faster.
-
JC Bernat Jakub Wieczerzak Venkata Neeraj Mamillapalli