Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

How can I ensure the proper order of event execution when using objects with multiple exit event ports?

Updated on January 27, 2017

When using multiple output event ports to apply logic, the order of the port firing is not guaranteed. For example, consider a component with True, False, and main event ports. You may expect the stack to be unwound when the True or False path has completed, and then fire the main event port. However, the order of the events leaving the block will not necessarily fire in that order. This example automation shows this scenario:

Connection block example

In this example, a control with True/False output event ports was used. However, the concepts in this article also apply to any component with multiple output event ports, such as ListLoop, ForLoop, and Switch.

These kinds of connections also impact code readability. It is difficult to follow logic when it does not flow from beginning to end. Note that connecting logic to the main event port that relies on the True/False execution paths to finish does not guarantee that one did so successfully, just that the thread ended. A final issue to be aware of is that you cannot use an asynchronous link or ParallelProcess component off of a True/False event as the main event port will fire before the downstream True/False or ParallelProcess logic is completed.

Resolution

There a several ways that you can correctly use multiple output event ports. These images show recommended automation examples:

Example 1:

Connection block example

Example 2:

Connection block example

Example 3:

Connection block example

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us