Posted: 16 Mar 2016 3:19 EDT Last activity: 16 Mar 2016 14:10 EDT
Java Vs Call Method for triggering an activity
I am doing a POC in V6.2 Sp2 where I need to fire activities dynamically based on the values in declare page.The declare page of type list contains properties holding value of both name and class of the activity to be called dynamically
I had the below two approaches
To iterate over declare page(list) and call the activity using Java(tools.doactivity) dynamically
To Iterate over declarePage(list) and call a wrapper activity where I pass the activity name and class has Parameter, This wrapper activity contains steps with call method for each possible activity and i have a precondition for each step to check whether the Param matches activity name
When I evaluated for performance using PAL,I found approach 1 is better compared to approach 2 .But since it uses Java it is not complaint with best practices.
Kindly advice what are the pros and cons in using Java instead of Call method for triggering activity.Also let me know is there any better approach available considering if I do the POC in Pega 7 as well.
It sounds like you could also implement your activity to be more perforamant. For instance, if you did a property set that concatenated your parameters so that it could be passed into the call method as a single string, you wouldn't need all the when logic. Certainly, using guardrails compliant solutions are easier to debug if something goes wrong. As Eric pointed out, if performance is key, then perhaps this is one of those cases where the potential problems debugging/maintaining non-guardrails compliant code may be worth it. Otherwise I would stick with the compliant solution.