I have a parent case A and two child cases B1 and B2. Parent case has wait shape configured with case dependency on child cases to be resolved.
Whenever each child case resolves, it updates a DB table with some records. For the first case B1, it works fine as PRPC triggers a commit after B1 resolves and updates the table.
But when B2 resolves and updates the table, PRPC does not trigger a commit and instead in the same requestor session the parent case A’s wait shape is triggered and progresses the flow which is impacting the further processing as data pertaining to B2 is not yet saved to the table.
In summary, PRPC is not triggering commit after the last child case is resolved.
Is there any way to achieve this without using write now or explicit commits?
This is an age old Pega bug. The commit happens but there’s a delay before which the parent moved forward. You can rectify this by adding another wait shape on the parent case after the case dependency wait shape. On the new wait shape, make it a timer type with the property reference of .pxCommitDateTime. Pega will wait for the commit before the parent moves forward. The delay is usually with a few seconds.
@RITVIK MOHAPATRA okay, you can also try this approach. You can do the save data page part on Queue processor or keep a wait shape with 1 second wait in the child case. Both the above approaches will process the case before resolving on different requestors.
@SohamM95 Thanks a lot Soham. Your solution worked perfectly. Adding a new wait shape with pxcommitdatetime makes the parent case wait for the commit to happen before proceeding.
@Anoop KrishnaQP is not feasible as there are many scenarios and 1 sec wait also I tried but it seems it takes more than couple of seconds. But thanks for the input. I will try what Soham suggested and respond.