More about Constraints rules |
Process Commander does not detect nor reject multiple constraints that are together impossible to meet, such as A > B and B > A. It marks both properties as not valid, each time either is changed.
During execution of a constraints rule, the page on which
the rule operates temporarily becomes the primary page. The
page keyword PRIMARY
and the results of the
tools.getPrimaryPage() PublicAPI method reflect
this change. When the constraints rule completes, the primary
page of the calling activity resumes as primary.
The contents of the selection lists on the Constraints tab depend on property alias rules and alias function rules.
The constraints are tested when a property value on the primary page (the page that matches the Applies To key part of the rule) changes. The following do not cause the constraints to be evaluated:
When appropriate, your application can display constraint rule violations immediately as a user changes an input value on a work object form or flow action form, rather than later when the form is submitted. The user can see the constraint message immediately.
For example, the constraint may require that the Due Date field be at least a week after the Start Date field. As a user enters and revises work object data, the constraint is checked immediately as user focus leaves either input field.
This feature can improve user productivity and accuracy, while also reducing the number of server interactions and HTTP traffic required to complete a valid input form. Consider whether and where such interactive checking may simplify the users' task of completing complex input forms in your application.
To implement this capability:
This feature is based on AJAX technology.
When you save a constraints rule, the system converts the rule to Java source code. As a learning or debugging aid, you can review this Java code.
Click the Show Java toolbar button () to see the system-generated Java code that implements the rule. The window presents a read-only preview of the Java that implements this rule instance. This Java code is not identical to the Java that executes at runtime, which includes Java code inlined from other rule instances and reflects rules in the requestor's RuleSet list.
Using the Tracer, you can watch the evaluation of a constraints rule. Start the Tracer and select a requestor session. Click the Options button () and check the Declare Constraint box in the Event Types to Trace section. Also check the RuleSet that contains the rule to be traced.
The statistic Tracked Property Changes on
the full details page of the Performance tool shows how many
property changes have occurred (for the current requestor since
log-in) that are tracked for declarative rules computations.
You can modify the prlogging.xml
file to log
additional details about tracked property changes. See Pega
Developer Network article PRKB-18112
How to determine which properties are tracked for
declarative processing.
Constraints rules, like Declare Expression rules, do not evaluate during the execution of an OnChange activity.