Sub-automations
Sub-automations
When creating automations with Pega Robot Studio, essential factors are readability and reusability. An automation developer should create short, modular automations focused on a specific task and reuse them in other parts of the project to achieve it.
If you analyze an automated process, you may discover that a user has multiple similar interactions with an application that often repeat across the automated use cases. For example, a customer support representative working for the banking industry changes a customer's ID number. The agent performs actions such as logging in to the application, verifying the customer's identity, navigating to the customer's data form, and sending the confirmation email. Each action that contains a sequence of steps is reusable in other scenarios, such as changing a customer address or opening an additional account. The automation developer implements those actions as reusable sub-automations to reduce redundancy in the project.
While developing automations, if a portion of the process is reusable, create the sub-automation. You can declare the input and output parameters of the sub-automation.
Best practices
- Give sub-automations a descriptive name that makes them easy to find and reuse.
- Provide sub-automations an entry point and at least one exit point. You must have all execution paths terminating at an Exit Point. You can add multiple exit points to terminate all potential endpoints in the execution path.
- Label exit points so that they make logical sense, for example, Success, Failure, and NoResults.
- Use Jump labels to consolidate some of the exit paths if they are related (for example, Success/Failure). For more information, see Label/Jump To components.
- Configure sub-automations to return any values that may be needed elsewhere in the automation with the exit point.
- Use exit point parameters to distinguish the execution paths for an automation.
In the following image, click the + icons to see details about a suggested method for using sub-automations and handling a common Exit Point scenario with Error/Exit parameters.
Check your knowledge with the following interaction.
This Topic is available in the following Module:
Want to help us improve this content?