Skip to main content

Declare OnChange form - Completing the OnChange Properties tab

Pega Community logo

Note: The following content, referenced from Pega Community, is included here to help you better achieve the module learning objectives.

Define the conditions that will cause this rule to be executed. Specify in an array the properties to be watched for change.

Properties, Conditions, and Action

Field Description
Properties to Watch This array identifies some of the properties that the rule tracks. Order is not significant.

See More about Declare Trigger rules for information about the properties tracked by the rule.

(1, 2, 3...) Enter the desired property references. Each property entered is monitored for changes. Identify a property on the top-level page (with a dot followed by the page name) or on a page identified by the Page Context field on the Pages & Classes tab.
  • If you list more than one property, they must be on the same page, either the top-level page or a common embedded page.
  • If you list more than one property, when two or more of the properties change value (for example, within a single step of an activity) this OnChange activity runs only once.
  • Start each property reference with a dot. You can't reference a property on a page other than the page corresponding to the Applies To key part of the rule or on a page identified by the Page Context field on the Pages & Classes tab.
Conditions
When Optional. Identify a when condition rule to be evaluated at the time a property value changes.

The system uses the Page Context value on the Pages & Classes tab (if not blank) as the Applies To key part of the when condition rule. If the Page Context value is blank, the system uses the Applies To key part of this OnChange rule.

Alternatively, you can enter a simple Boolean expression here, for example in one of these formats:

property = "constant value" property1 > property2

You can reference linked properties in the expression. Don't use a complex Java expression or an expression that calls a function here.

When this OnChange rule used to suspend work item processing, this when condition is known as the business exception.

Choose Action...
Choose Action Select:

When True Run and When False Run

Complete these fields when you select Call Activity in the Choose Action field.

Field Description
When True Run
Activity Enter the Activity Name key part of an activity to execute when any of the specified properties change (and the test in the When field evaluates to true). Choose an activity with an Activity Type of OnChange (recorded on the Security tab). If the activity has input parameters, click Params to enter literal constant values for them.

The system uses the Page Class value on the Pages & Classes tab (if not blank) as the Applies To key part of the activity. If the Page Context value is blank, the system uses the Applies To key part of this OnChange rule.

See More about Declare Trigger rules for more about the activity.

When False Run
When False Run Optional. Enter the Activity Name key part of an activity to execute when any of the specified properties change and the test in the When field evaluates to false. Choose an activity with an Activity Type of OnChange (recorded on the Security tab). If the activity has input parameters, click Params to enter literal constant values for them.

See More about Declare Trigger rules for more about the activity.

Suspend Section

Complete these fields when you select Suspend Work Object in the Choose Action field. See Policy overrides and suspended work items.

Field Description
Suspend Section
Policy Override Flow to run Enter the Flow Name key part of a flow to execute to support review of the suspended flow. Ensure that the flow meets the requirements listed in How to implement business exception processing with policy overrides.
Error message Enter the third key part of a field value rule with first key part @baseclass and second key part pyMessageLabel, or enter literal text between double quotes to identify this source of policy override reviews.

  • About Declare OnChange rules

    Create Declare OnChange rules to run an activity automatically at activity step boundaries when the value of a specified property changes. This capability provides a form of automatic forward chaining.

  • Declare OnChange rules -
  • Viewing rule history

    You can view the saved history of a rule to see when it was changed and by whom. You can also compare the current version with a previous version or restore a previous version of a rule for testing purposes, or if the current version is faulty.

  • More about Declare Trigger rules

    Create Declare Trigger rules to cause an activity to run when instances of a specific class are created, updated, or deleted in the database. This implements a form of forward chaining.

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

Did you find this content helpful?

100% found this content useful

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