Switch

The Switch component lets you  use conditional logic to execute automation events. For example, use this Switch to trigger specific events based on the index of the toolbar button selected.

Note: A Switch statement can only work with input types that can be edited, such as strings, integers, enumerations (like BorderStyle). For example, connecting the SelectedItem property from a list box to the input of a Switch fails because the SelectedItem property is of type object and has no editor.

For more information, see General Component Properties, Methods, and Events.

 

Properties

Property

Description

Input

Supplies the value used in the comparison and evaluation of the cases.

 

Events

Event

Description

Cases

An event is created for each case that you define for the switch. To add a case, click the plus sign on the design block. Type a value or string to which you want to compare the input. The case that matches the input is fired when the Execute method is triggered. If none of the cases match the input, the default event fires.

Default

This event fires when none of the cases match the input.

 

Methods

Method

Description

Parameters

Result Type

Execute

Compares the Input property to the cases defined (by clicking the plus sign on the design block). If a case is matched by the Input, the event for that case fires. Otherwise, the default event fires.

Input - String, Int, Enumerated

Void

 

Related information

Using the Switch Component

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label