Declarative rules features
Where you can get access the declaratives defined in that application?
Declarative rule execution
Forward chaining is executed when the value of any of the source properties change. Most of the declarative rules follow forward chaining.
Backward Chaining mode executes when the target property is referenced. Backward chaining is supported only for declare expressions.
How declarative rules recalculation can be triggered?
Forward chaining:
1. Whenever inputs change
1: the expression is calculated whenever any of the source properties change
Backward chaining:
1. When used, if no value is present
2. When used, if property is missing
3. Whenever used
1&2:
make sure the expression is calculated only once in the case lifecycle unless the property is removed from clipboard.
3:
system throws a performance warning, indicating that the expression will fire as many times as the target property is referenced
(The target property is considered used when it’s referenced by its name, such as in a UI rule, in a decision tree or in a data transform.)
Declarative rule execution in case of Constraints
when the value changes, the constraint is executed to verify that the value conforms to the conditions expressed. Constraints can have any number of rows and the order in which they are listed is not significant. The message text can be entered directly in the rule form or saved as a message rule which can be referenced.
Declarative rule execution in case of OnChange
Declare OnChange can track several properties that have been saved as part of the case. When one or more of these properties change it invokes the activity which has the logic to be performed. The Declarative Engine invokes the activity only once if more than one property gets changed.
Declarative rule execution in case of Declare Trigger
The Declare Trigger executes when instance of its classes are created, saved or deleted in the database. On the database event, it triggers an activity which contains the logic to be performed. Triggers can be used in cases when we want to capture the history of how a property got different values over the case lifecycle. For example, the audit trail must contain information about the different values stored as part of discount. Whenever the values in the discount change, it causes the trigger to fire the standard activity which writes an entry to the audit trail.
What are the performance impacts of using/not using Declarative Processing?
What additional setup is required for a Declare Expression if the target property is a page list or a page group?
If the target property is of page list or page group then we need to identify the Page Context. ( .LineItems() )
Ways to set target property value in a Declare Expression
Value of:
others:
for text:
- can be only Value of and Result of: free form expression, string replace, lowercase, substring, trim white space, uppercase
What is a function rule?
A function is a rule type in Pega that is used in various other rules. Functions allow us to extend PRPC capabilities by using custom java code. Functions belong to Technical Category (Rule-Utility-Function) and are grouped by Library.
What is Context Execution behavior?
The term context sensitive really means that the path defined by the page context + target property must be complete from the top level page that derives from the Applies to class.
Context free expressions allow us to define the expression without taking into account where it is used in the expression. This option is best used for calculations that are ALWAYS necessary and the same, regardless of where the object is embedded.
What is Declarative Network?
How you can unit test a declarative expression?
In which situations Declare Expressions are useful?
Declare expressions are useful in cases when we want to calculate the total price on a purchase request, or derive the quote for an insurance policy.