Skip to main content

Application events

Application events notify you about changes in the application or the Application Asset. For example, a control has been created or destroyed, or its state has changed. When developing an application, you can expose events that are useful to an automation developer through basic events on the application interface. Additionally, you can define advanced events that are not based directly on application controls, but convey process information and state, such as whether the application is logged in or whether the customer is a high-value customer. 

Basic events

When creating an Application Asset, you can make certain events and their implementation available to the automation developer. To do so, create basic events that are built upon the existing events of the interrogated control. 

For example, the BankerInsight application has a label named lblNotification that displays a message upon the completion of specific actions, such as showing, saving, or editing customer data. To expose the text changed event of the label for the automation developer, you create a basic event that is raised when the label TextChanged event is raised, as shown in the following figure: 

The Interface tab of the application showing the procedure of adding a basic event to the Application Asset.

The customerNotificationChanged event becomes part of the application interface and can be used by the automation developer. Furthermore, you can use the event internally in the application implementation to trigger an action when the event fires. 

For example,you might create an event-triggered application method to perform specific actions depending on the message displayed in lblCustomerNotification. 

In the following image, click the + icons to learn more about an example event-triggered application method:

Advanced events

When building Application Assets, you can also create events that are not based on events raised by application controls, but that reflect the completion of a specific scenario. For example, you create an application method that adds a new account type for an existing customer in the BankerInsight application. After adding the account, you might want to finish processing the selected customer and return to the application's home page. 

To do so, first create an event indicating that the procedure ended successfully. As the event is not connected with any particular application control, set the event as Advanced, as shown in the following figure: 

The Interface tab of the application with the new event form opened, and the Advanced option checkbox indicated.
Note: When creating advanced events, use descriptive names that reflect the actions performed, which helps with documentation. 

To raise the newAccountAdded event at the end of the successful path of the AddNewAccount automation, add the FireEvent method to the automation run flow.

In the following image, click the + icons to learn more about raising an advanced event in automation:

After adding the FireEvent method to the automation, click the eventName on the newly added design block to select the event that you want to trigger from the list, as shown in the following figure: 

The FireEvent design block with the menu allowing to select the desired event to fire.
Note: The FireEvent method is a part of the application implementation, and an automation developer cannot access it in the target project. 

Check your knowledge with the following interaction:

 


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice