Properties, methods and events
Properties, methods, and events
When building automations in Pega Robot Studio, the automation developer should analyze the process and end-user interactions. In the automation, design blocks reflect the steps taken by the application user. After interrogating the application, the automation developer adds the application to the automation designer Palette, giving access to all properties, methods, and events associated with each control. Properties, methods, and events are the main building material of the automation.
The properties allow the automation developer to access all the characteristics of a selected control. For example, the properties for a text box include the following settings:
- Enabled – Indicates a value indicating whether a control can respond to user interaction.
- IsPassword – Returns True if a control contains a password.
- Visible – Indicates whether the control can be seen within the application or is hidden.
The automation developer can use these properties to determine the logical flow of an automation. Some properties represent the size of a control, location to a parent control, text associated with a control, and more.
An automation developer can change many properties for interrogated controls; for example, you can edit a Text property to change what is written in a form field.
Methods allow developers to interact with application controls. For example, with methods, an automation clicks the button, chooses an option from the combo box, or gets the text buffer from a control.
An automation developer can also use methods to change the properties of a control. For example, a Disable() method changes the Enabled property so that the user can no longer interact with the control.
Events are used to set up a starting point of an automation. The end user can trigger the automation to start by interacting with a user interface element, such as, by clicking, inserting, or changing a text, or focusing on the control. An event can also occur when a specific webpage or a window is created, loaded, or activated.
Example of properties, methods, and events in an automation
An online shopping company uses a webpage to collect client orders, but the company also has a legacy Windows application, which is used by the shipping department. Every time a new customer is added, an employee must manually transfer the client's data to the legacy application.
The company decides to automate the process. The first draft of the automation opens the proper form to transfer customer data to the legacy application.
The automation starts when the user double-clicks the Customer Name to copy data.
The automated process logs in to the legacy shipping department application by inserting a user name and password and then clicks the Login button.
When the main screen of the application loads, the automation clicks New Call to open a new form for customer data.
In the following image, click the + icons to see an example of an automation created in Pega Robot Studio that meets the example requirements.
Select Action window
The Select Action window allows developers to add a property, method, or event associated with a control to the automation. The window is displayed when the automation developer drags a control from the automation designer Palette and drops it to the design surface.
In the following image, click the + icons to view the components of the Select Action window.
Check your knowledge with the following interaction.