Datapage activity is not executing with Pega 7.1.7
Data page activities are sometimes not executing, leading to data not being saved in the database.
Steps to Reproduce
- Have an activity execute a Load-DataPage method . The datapage is of thread scope. Do not add a "connect-wait" to wait until the data page loads.
- Have the calling activity and parent Requestor immediately exit.
An issue in the custom application code or rules. If the Parent Requestor exits before the child requestor services the load request, then the load is not performed. There is no point to the load, because the Thread scope for the data page is now gone, and no one can look at the data page even if it were to be loaded.
For this example, the load activity was made to add data to an external database; this data was not part of the data page. The use of the load activity to perform this ancillary function is ill-advised as there is no guarantee that the activity will always be called if the decision to not load the page is made.
If logging is set to DEBUG for the class adp_lifecycle, then you will see this (slightly misleading) log entry which indicates that the page has not bee loaded:
2016-05-09 11:13:55,282 [PRPCWorkManager : 11] [ STANDARD] [ ] [ PegaRULES:07.10] ( pega.TRACE.adp_lifecycle) INFO - Requestor:AB6D945EAE0295FB3FCD537DE3A40A925,thread:STANDARD: Avoided loading DP - A9793A4ED5EEA31C18D2ACFF6552146EB_STANDARD_D_LogReqResp_............ in thread - WorkManager.PRPCWorkManager : 11 as it was loaded synchronously by user thread.In fact the page was not loaded by a user thread at all.
Here’s the explanation for the reported behavior: As indicated above, if the parent thread exits before the load request is serviced, then the load request will be canceled. A "connect-wait" after the load request will ensure that the calling thread does not exit before the page loads. Using the load activity to write data to a database is making use of a side-effect to the ADP design, and outside of the guardrails.