Pega - Declarative Rules Interview Questions and Answers


Staff member
Declare Expression
1.Declare expression assigns value to a target property.
A = B+C

A is target property
B and C are source proeprties.

Declare expression gets executed whenever there is a change in source property values. This is called “Forward Chaining”.

Go to my you tube channel to watch backward chaining.

*Declare expression is an alternate rule to activities property-set
Activity or DTf we need to call, where as Declare expression no need to call.

2. I want to restrict a property to be not used as a target property in declare expression, by developers. How to do it?
Go to property -->Advanced tab --> Select “Cannot be a declarative Target”.


3. We have a property A, which is target property in Declare Expression. Can I use this Property ‘A’ to assign a value using activity or DTF? YES/NO, Why?
A. NO, we can not use that. Because a target property of expression cannot be assigned from any other rule.If we use, PRPC throws compilation error.

For Your Inofrmation-->
We used to have change tracking tab in declare expression before Pega 8.2 version. From 8.2 onwards it has been removed for below reason. Still we can access it.
Change tracking tab removed from declare expressions
To simplify declare expression configuration, the Change tracking tab has been removed from the declare expression rule form. To use the Change tracking tab, on the declare expression rule form, click Actions > Use legacy expression.
To access older version rule form of declare expression.


Now, we got change tracking tab.

Question : Is declare expression forward or backward chaining?
Answer : It has both behaviours.

Declare On change

1.What should be the activity type when we call it from declare on change

2.The property-set we do using declare expression, the same can be done in declare on change as well.
Then why we need declare expression as a separate?

A.Declare on change is only forward chaining, whereas declare expression has backward chaining is also possible.
Declare on change can do, what a declare expression does, only in case of Forward chaining manner but, a declare expression’s backward chaining cannot be done by declare on change rule.

3.Can we do property-set (in the Onchange activity) of same property(s) which are involved in declare on change rule? What happens if we do it?
A.The processing or execution of activity go into INFINITE LOOP.

4.If we directly update a property value from clipboard, which is involved in declare on change rule. Does it executed Onchange rule?
A.Yes, it does.