Creating Application methods
Application methods are single-purpose automations that you can create to use in solutions, just like any out-of-the-box method. Use the Application method feature to automate common tasks and make the end-to-end process more efficient.
For example, you need to create a solution that logs into an application, searches for a customer, and updates the customer address. Because these are common tasks that you are likely to use again, create application methods for each task and call them from the external automation.
Applications have methods that are available out of the box, such as Start, Stop, Hide, and Show. The Application methods feature allows you to add your own custom methods to applications. Use application methods as building blocks that perform commonly used functions, such as Login, AccountSearch, and AddNote. Application methods are private to the application and cannot be used by automations directly. Instead, the application methods are available on the Select action dialog along with out-of-the-box methods.
- In the Project Explorer, right-click an application, and then click .
Result: On the Add menu, you see an additional option: Application method.
The following figure shows the Application method menu options:
- Select Application method.
- In the Add new automation dialog box, enter a name for the
automation, as shown in the following figure:
Result: The system creates an automation that is a child of the application. The name of the application method reflects its dependency on the application. with the application name preceding the name you gave the automation, as shown in the following figure:
- On the automation surface, right-click, and then select Add Entry point for the scoped automation.
- Click the automation surface, and then click IsExternal
in the Property Grid to the right.
Result: This setting makes the application method public and available in the Select action dialog box. Note that you can have an external (public) application method that calls an internal (private) application method. For example, an UpdateCustomer Application method can call the internal Search method.
The following figure shows the Login application method as a method in the Select Action dialog box that an automation can use or call.
- Build your automation using controls from the Toolbox
Result: Limit the scope of application methods. In this example, an Application method performs one specific task: Login or Search. Limiting the scope makes it easier to share, reuse, and test scoped automations.
The Project Explorer shows the dependency of the application methods to their application, as shown in the following figure. When working with Application methods, you see only the controls and methods that exist for the specific Application method. For example, there is no access to Globals or other applications.
The external automation calls the Login and UpdateAddressApplication methods to perform the address-change task.
The UpdateAddress Application method calls the internal or private Search method.
- Predefined application methods
Each time you add an application to a project in Pega Robot Studio, two application methods are created automatically: StartApp and StopApp. These predefined methods are useful to make sure the app is in the correct state, and can be called from other automations.
Previous topic Factories Next topic Predefined application methods