Activity End and Exit Activity methods in pega

Activity-End method?

Use the Activity-End method to cause the system to End the current activity and all calling activities.

Example: If Alpha calls Beta, which calls Gamma, which calls Delta, which performs the Activity-End method, all four activities are ended.

Exit-Activity method?

The Exit-Activity method ends the current activity and returns control to the calling activity.



5 comments:

  1. Exit activity example plz mentioned

    ReplyDelete
    Replies
    1. In Pega an Exit Activity is an activity that can be used to stop the processing of the current step or flow and exit without continuing further It is typically used to terminate a process flow early under certain conditions like when a decision is made that further processing is unnecessary

      Here is an example of how to use an Exit Activity in Pega

      Scenario Using Exit Activity in a Flow

      Lets say you have a flow where you are checking if an applicant is eligible for a promotion If they are not eligible you want to exit the flow immediately without executing the subsequent steps

      Steps to Create and Use Exit Activity

      1 Create an Activity Exit Activity
      Go to the Records menu and choose Technical Activity
      Create a new activity For example ExitPromotionEligibility

      2 Define Steps in the Activity
      In the Steps tab you can define the logic for the exit condition Lets say you check an applicants eligibility If they are not eligible you can use the Exit method to stop further processing

      Example steps for the activity

      Step 1 Check eligibility
      Use a When condition to check eligibility eg ApplicantEligibility property
      Action If condition to check whether the applicant is eligible

      Step 2 Exit if not eligible
      If the applicant is not eligible use the Exit method
      Example action in the step Exit with an optional Exit Code eg NotEligible

      Example pseudosteps in the activity

      Step 1
      Action If
      Condition ApplicantEligibility false

      Step 2
      Action Exit
      Exit Code NotEligible this is optional but useful for logging or tracking the exit point

      3 Invoke the Activity in the Flow
      In your flow for example a Process flow you can call this ExitPromotionEligibility activity
      When the activity runs if the eligibility check fails it will invoke the Exit action and stop further processing

      4 Example Exit Activity Code

      java
      Step 1 Check eligibility
      If Property ApplicantEligibility false

      Step 2 Exit the activity if not eligible
      ExitNotEligible Optional exit code



      In this example
      If the ApplicantEligibility property is false the flow will exit immediately without executing the next steps
      You can optionally log or handle the exit by passing a custom exit code

      5 Testing and Debugging
      You can test the activity using the Tracer tool in Pega to ensure that the exit condition is being triggered correctly and that the flow is being stopped as expected



      Summary

      Exit activity is used to stop the flow processing immediately
      Typically its used when a condition is met and further processing is not required
      You define an exit in an activity using the Exit method in an activity step

      This approach ensures that once an exit condition is met the flow terminates without further steps being executed

      Delete