Need Suggestion on - Application's CUSTOM Activities Optimaztion with DataTransforms
In our Pega application, we are looking at an Initiative - Application's CUSTOM Activities Optimation with DataTransforms. Basically, we want to review the major activities configured in our application to see if we can re-write them to Data Transforms.
Why Pega recommends DataTransforms over Activities?
Why ACTIVITIES should be considered as LAST OPTION ?
What are the KEY Benefits of having our code in Data Transforms rather than Activities?
The thought of this Initiative... Is it worth ???
If this Initiative is worth... then with what type of Activities we should Start with ? Like...
Activities with more Steps in it ?
Activities which are taking more time, CPU, etc to complete ?
Please share your thoughts and advises... so that it will be helpful for us to Proceed.
Hari Kumar Alampuru
***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
From my experience, Data Transforms tend to be more 'self documenting' than their Activity brothers, and are also slightly more optimized for doing things like data mapping. I would say that a general rule of thumb is....
If you are doing any kind of 'Data Mapping', that is copying/moving/transforming data from some source to a target, then a Data Transform is your best bet. There have been several enhancements to DTs the enable faster moving of data between pages (specifically being able to Set a Page List property without iterating through the whole thing, ie: Set MyPageList Property to DataSource.pxResults).
Data Transforms also allow you to add 'comment' steps that help make them easier to read. The very nature of the Data Transform rule makes looking at them much more intuitive than an activity whose steps you have to expand before being able to understand what is going on.
In a case where you need to do more 'processing' that does not fall into something like a Flow, then an activity is the right choice. Usually you would use an activity if you are calling one of the Pega API activities (or your own activity that eventually calls a Pega API activity), or if you are trying to invoke a Connector or expose a Service.
I don't think the advice is that Activities are the 'Last Option', I believe it is more a case of 'use them when appropriate', as opposed to the traditional Pega development where they were really the only tool in your tool box for getting things like Data Mapping done.
I hope this has helped. I had planned on developing a quick video on this topic (I think it was might have even been intended for you, though I'm not certain), regarding a particular set of activities that did some complex calculations for payments. That use case could have been greatly simplified by using a combination of declaratives and data transforms.
Thanks so much for the quick & detailed response !!
Just to summarize, on the benefits which you mentioned in your earlier note.
From Performance perspective:
DTs slightly more optimized for doing things like data mapping.
DTs are efficient for faster moving of data between pages
From Developers/Code Understanding Perspective:
Data Transforms allow developers to add 'comment' steps that help make them easier to read.
Data Transforms tend to be more 'self documenting' than their Activity brothers
I think, our leadership will be interested more on the Performance perspective. I will start this Initiative by identifying the Top 10 Activities in which extensive DataMapping happening and see if they can be impolemented in DataTransforms.
Once again thanks for reply. Will keep this discussion Open for few more days so that others who already worked on Similar Tasks or on DT's to share their thoughts.
Also, quite simply, as Activities can be written to do *anything*, so your LSA's (or anyone wearing the hat of a code-reviewer) needs to spend more time reviewing them.
I'll add, there was, at one time, a vision to produce a readable output of an activity (expanding preconditions/transitions but only where used, expanding parameters and displaying them in full outside of the input boxes). This could easily be built as a 3rd-party tool.