Question
Virtusa
US
Last activity: 23 Jan 2025 6:02 EST
UpdateCoveredTasks Trigger when pxCoveredCountOpen is modified
Hi,
When pxCoveredCountOpen is modified and saved why does "UpdateCoveredTasks" declare trigger gets invoked which is watching only "pyStatusWork" and pyStatusWork is not modified .
Pega Version : Pega 23.1.2
Thanks.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Virtusa
US
Update: I have observed that the properties used in the declare trigger when condition is automatically being tracked for changes even though not added in the list of properties to watch .
Is this an expected behavior of declare trigger rules ?
Aaseya IT Services Pvt LTD
SA
When you are changing the pxCoveredCountOpen property, you are basically changing the status only. The property signifies that the there are covered child cases open with a parent case. If you add or remove any count from there, means you are either resolving the covered child cases or moving them to In progress or pending state
HCA Healthcare
US
The pxCoveredCountOpen
property in Pega indicates the number of open child cases associated with a parent case. Modifying this property directly is not recommended, as it can lead to inconsistencies between the actual state of child cases and the parent's data. Instead, you should manage the statuses of child cases appropriately, allowing Pega to automatically update pxCoveredCountOpen
. For instance, when a child case is resolved, Pega decreases the pxCoveredCountOpen
value for the parent case. Conversely, if a child case is reopened or a new child case is added, Pega increases this count. Direct manipulation of pxCoveredCountOpen
can disrupt this synchronization, leading to errors during case processing.Also if the user experienced issues with incorrect pxCoveredCountOpen
values, which caused errors when resolving child cases. The recommended approach was to ensure that child case statuses are managed correctly, allowing Pega to handle the count updates automatically. Additionally, reviewing the system for any known bugs or applying relevant hotfixes was suggested to address potential underlying issues.Therefore, it's essential to manage child case statuses through standard Pega processes and avoid direct modifications to the pxCoveredCountOpen
property to maintain data integrity and ensure accurate case management.
Updated: 5 Jan 2025 15:32 EST
Virtusa
US
@PrakashDeep : pxCoveredCountOpen and the declare is just an example of OOTB rule , but it happens with any declare trigger rule when condition , so wondering if its a bug ? Issue here is declare trigger is invoked when a property in the when rule is modified which is not being watched in declare trigger rule .
Also in scenarios where child case is getting resolved , pxCoveredCountOpen is updated in parent case where pyStatusWork is not updated.
Aaseya IT Services Pvt LTD
SA
Sorry for earlier response, I mistook it for a declare on change rule.
This is a declare trigger rule. It doesn't depend on the property to be modified. Declare Trigger rules respond to any property change event within their scope, not just the specific property.
So, when you are updating the pxCoveredCountOpen, you are basically doing a save on the case which we will call the declare trigger rule as expected. This is an expected behaviour only.
Virtusa
US
@PrakashDeep , Declare trigger can be invoked when a specific property is saved (check my original post screenshot) . As per that it should not fire for any other property save . but here the property in the declare trigger when rule as well is being used as "one of the these properties modified". its very confusing so better not to use a declare trigger when rule and instead use the same when rule in 1st step of the declare trigger activity and exit the activity when the condition fails.
Aaseya IT Services Pvt LTD
SA
This is what I got for declare trigger in PEGA.
"In Pega, the behavior you described can occur due to how Declare Trigger rules are designed to work.
When a Declare Trigger rule is configured to watch a specific property (e.g., pyStatusWork
), it will trigger its defined action whenever any property changes, not just the property it is explicitly watching. This behavior is by design in Pega.
So, when pxCoveredCountOpen
is modified and saved, even though the Declare Trigger rule is explicitly watching pyStatusWork
, if the property change event is detected (such as the modification of pxCoveredCountOpen
), the rule will still be invoked.
This behavior can be unexpected if you are assuming that the Declare Trigger rule will only be invoked when the watched property (pyStatusWork
in this case) is modified. However, in Pega, Declare Trigger rules are designed to respond to any property change event within their scope, not just the specifically watched property."
Updated: 13 Jan 2025 8:47 EST
Virtusa
US
@PrakashDeep I tested this and observed that it is not invoked for all properties , but only for the properties used in the declare trigger when rule + Watch Properties in the declare rule
Aaseya IT Services Pvt LTD
SA
Try one thing,
In the "Copy To" column, you can keep another property to copy the current value of the property which has been modified.
So when the trigger executes, You can go back and check if that status or any property from when rule is being updated and causing declare trigger to fire up.
Ideally, any property from when rule if changes should not trigger declare trigger. That is not the purpose of that.
Virtusa
US
@PrakashDeep I think its a miss in the documentation , for Declare on Change its documented . but not for declare trigger . Since there is no mention of this in Declare Trigger it is causing confusion.
https://docs.pega.com/bundle/platform-23/page/platform/app-dev/more-about-declare-onchange.html