pxAddChildWork doesn't use unique page name
The user reports that the pxAddChildWork activity does not create multiple covered work objects using the same class. This is happening after the migration from PRPC 6.2SP2 to Pega 7.1.8. The user wants to use the standard Pega rule pxAddChildWork but the standard Pega rules uses a page name for the childPage with the class name and error.
Error in Tracer: Flow_NullWorkPage on primary page
Error in log:
(WithErrorHandling.Work_.Action) ERROR - Error in commit()
(WithErrorHandling.Work_.Action) FATAL - .pyCommitError: ** A commit cannot be performed because a deferred save of instance XYZ-WORK-YY AAA-150 failed : code : <none> SQLState : <none> Message : <none>
Steps to Reproduce
- Create One work object called AAA - Work object created by external application
- Create Two covered work objects called BBB - Covered work object created by an activity during AAA flow. These work objects are created individually.
- Create Several covered work object called CCC - Covered work object created by declare onChange and activity during AAA and BBB flow.
- Observe: CCC work objects ("grand-child") are created in the same transaction that is, they must use the same class but unique page name.
- Observe: pxAddChildWork does not use a unique page name and the logic fails in this case.
Tracer shows "Workpage not found" and Fails at the time of creation of CCC for the second BBB object. A simple local-change is to do a save-as of the pxAddChildWork final activity (rename) and append pgID to the page name to make it unique. This works on PRPC 6.2 SP2 and the same works on Pega 7.1.8 as well. However, this is a final rule and proves futile in the long run. When multiple child workitems are created using pxAddChildWork in one transaction, same page name is used and this causes the issue. The java code in pxAddChildWork must be modified to use a unique page id for creating covered work objects in the case of recursive call.
0% found this useful