How to cancel parent case upon canceling child case

How to cancel parent and other child cases after cancelling child case in pega?

@RaghavN2

You can use an ‘Update a case’ shape to move the parent case to an alternate stage where it resolves to Resolved-Cancelled and ‘Resolve open child cases’ checkbox is checked in the stage.

@SohamM95 hi Is it Update a case or change stage pls confirm, if it is Update a case shape pls elaborate

@RaghavN2

You can use Update a case shape where you can form your own logic to update the parent case and move it to alternate stage using pxChangeStage where you can resolve all the child cases.

@RaghavN2

It can be achieved by using activity but Activities are not recommended by Pega.

In update case shape select single case and give.pxCoverInsKey in withID parameter which will refer to parent case and write a own DT and Refer call OOTB Activity (pxForcecaseclose) using function to call activity in DT and pass parameters Parent WO ID ,WorkStatus this will close all the cases and it subcases.

Refer to OOTB pxForcecaseclose Activity.

@RaghavN2

Approach 1 :

Call update status shape and select single case then Configure your update shape as follows. .pxCoverInsKey will refer to parent case.

Approach 1:

Refer DT Step 1 : Param.inskey = pyWorkCover.pxCoverInsKey

Step2: Call OOTB pxForcecaseclose activity as pass the required params

Function to call activity in Data transform @Utilities.pxExecuteAnActivity(myStepPage, “pxForcecaseclose”)

Other Approach :

In Data transform Call pxChangeStage activity and pass Stage name as a parameter and in Alternate Stage -Select Resolve the case,case status and select Delete open assignments/Resolve open child cases.

Function to call activity in Data transform @Utilities.pxExecuteAnActivity(myStepPage, "pxChangeStage ")

Thanks,

Vikram

@RaghavN2

You can configure an utility in Child case “Canceled” stage. Build a custom logic to perform change stage for Parent and other child cases to move it to “Resolved-Cancelled” stage based on your requirements (if one of the child is cancelled).