Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Last activity: 27 Dec 2017 12:49 EST
Alternate method of achieving the same functionality as the Activity-End method for Pega 7.2.2?
Hello,
Is there any alternate method of achieving the same functionality as the Activity-End method for V 7.2.2?
***Updated by moderator: Lochan to branch reply and create new post***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
EPAM Systems, Inc.
ES
Hi Vinay,
Thanks for posting on PSC.
Alternatively, use the Exit-Activity method, not Activity-End, to return to a calling activity from an internal step of the current activity.
Refer it: -https://community.pega.com/sites/default/files/help_v722/procomhelpmain.htm
Or else you can function as well "pega.terminateActivity() "
Hope it answers your query, kindly mark as answered if it does.
Regards,
Asif
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Hello Asif,
Thanks for responding, For my case below Exit-Activity will not satisfy the requirement.
However when I use pega.terminateActivity() it still shows the same exception as with Activity-End Method. My requirement is like below:
From a flow utility I call Activity A which calls Activity B which calls Activity C. Now in C I am doing some validations and when a condition fails, all the remaining process in B and A should stop and the control needs to be handed back to the calling Utility Activity.
Hope the requirement is clear.
Thanks,
Vinay
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689877000/122ddbf9-8ed7-431e-8c0c-0892f658c39d.png?itok=HwmzfVHs)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689877000/122ddbf9-8ed7-431e-8c0c-0892f658c39d.png?itok=HwmzfVHs)
Pegasystems Inc.
US
Hi Vinay,
Thanks for the clarification. I believe you can use a flag parameter in this case and use this parameter in this activity. For example, if inside activity C some validation fails then you can set this flag to false and use Exit-Activity. I believe this should work out for you. Please let us know if we misunderstood something. BTW, what is the error you are getting in case you use terminateActivity().
Regards,
Rachit
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Hello Rachit,
Thanks for the response. Lets Say In Activity B there are 10 lines of code (each one is a when rule validation). Activity C is called out at every step to add some values to a page list. Now when the length of page list is greater than 1 I need to exit out of all the remaining code and send the WO to a workbasket. If I were to use the method as suggested above, I have to check for the condition in the Jumpstep for every step in the activity. Hope this is clear.
When I use terminate.Activity(), I see UniqueActivityTerminateExceptions which is the same as when I use Activity-End method.
Also when I create some empty activities with 2 or 3 steps like setting a few parameters and use Activity-End method it seems to be working fine, but when I use that in the original code I see the exception. Is it the general behavior of the method?
Thanks,
Vinay
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hi Vinay,
I would like to understand your business requirement as Activity-End and Exit-Activity are not exactly same in terms of its functionality.
Exit-Activity method will end the current activity and returns the control to the calling activity whereas Activity-End method will end the current activity and all calling activities too.
So based on your business requirement you can choose one among the above 2 methods, hope it is clear for you.
Regards
Mahesh
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Hello Mahesh,
I have posted my requirement in the above comment thread, please have a look at it.
Thanks,
Vinay
Updated: 27 Dec 2017 12:49 EST
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Swedbank AB
SE
Hi Vijay,
I agree with Rachit. You can set out return parameters and use those in calling activity step transition to exit the activity.
Thanks,
Deva