Alternate method of achieving the same functionality as the Activity-End method for Pega 7.2.2?


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***

**Moderation Team has archived 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.

Branched Post Information: 


Keep up to date on this post and subscribe to comments

December 26, 2017 - 5:43am

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: -

Or else you can function as well "pega.terminateActivity() "

Hope it answers your query, kindly mark as answered if it does.



December 26, 2017 - 11:00am
Response to Asif Hasan

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. 



December 26, 2017 - 12:08pm
Response to VinayR28

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().


December 26, 2017 - 1:11pm
Response to Rachit_Agarwal

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?



December 26, 2017 - 10:11am

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.



December 26, 2017 - 11:01am
Response to Mahesh Midthuru

Hello Mahesh,

I have posted my requirement in the above comment thread, please have a look at it.



December 27, 2017 - 12:48pm
Response to VinayR28

Hi Vijay,


I agree with Rachit. You can set out return  parameters and use those in calling activity step transition to exit the activity.