Posted: 12 Nov 2018 8:48 EST Last activity: 15 Nov 2018 9:18 EST
Delete Open assignment on change of stage
we have a case life cycle which is configured with multiple stages , There is a possibility to have two parallel assignments . On post submission of one assignment , case is advanced to next stage. I see, Pega engine is not deleting the open assignments when case is moving on between stages.
Do I need to place pxChagestage smart shape in every last step of the stage to clean up the open assignments .?
***Edited by Moderator Marissa to update platform capability tags****
As i mentioned earlier ,Yes, we can place Changestage smart shape in last step of current stage to move the case to next stage along with clearing the current assignments.
I would like to understand , Can't pega engine take care of the same (as deleting assignments) when case is navigated from one stage to another stage automatically ?. I see, System is passing CleanUpProcess parameter is blank in tracer .
We have situation to create task on demand, like whenever manager request users for additional document (local action) then task needs to be created for the users who doesn't have it. To achieve it , on submission of location action ,we are creating the assignments by staring the flow.
1) Two sub flows ,Assume SF1 and SF2 .
2) SF1 has an assignment for manager and it's configured with local action to request for additional documents.
3)SF2 is configured with Split For Each to create assignments for all users to upload the requested default documents as per business rule.
4) Two subprocess are being initiated parallelly through Split Join ( condition type : "Some" whenever SF1 reaches the certain flow status ,which is configured on End shape of SF1 then system deletes all assignments from SF2) ,It's expected and working fine. As Manager is ok to proceed with case without additional documents from users.
5) Concern here ,One or All users uploaded the default documents by submitting the tasks ,which gets created for them initially through SplitForEach .
By this time ,we have only one task in system which is available with manager and If manager still need more documents from users then he can take local action to request for additional documents from all users . To achieve this , On post submission local action, we are looping through users list and calling the subprocess which is configured in split for each shape to create the stand alone assignments for users.
Now, few users uploaded the documents and manager has decided to proceed with case further and the Case is moved to next stage but the remaining assignment of users who hasn’t taken action are still persist.
Just tried to place the pxchangestage shape explicitly to clean up the process but doesn’t work .
have tried to use pxDeleteAssignment to delete the stale assignments at end of flow .It's deleting the stale assignment but the process flow is not moving forward with current assignment to next stage, just displaying the confirm Harness and Need to open it again and submit it to proceed further .
Step Status Info
trying to calculate the handle of a class whose instances may not be written to the database: Work-: code: SQLState: Message:
Seems,ChangeStage api doesn't care about the assignments ,which are raised through spinoff and startflow activity .Any Work around for this ?
I tried to below approach as well but not successful .
Using pxDeleteAssignment ,Trying to delete one assignment (assume stale) on submission of other assignment. The stale assignment is getting deleted successfully but current assignment is not moving to next stage or to next assignment. By default It's showing up the confirm harness ,hence we need to open the case again to proceed further.
and I’m passing param.commit is false. It’s being invoked from flow utility before end shape of the flow.
I see, Below flow message Info in tracer after completion of pxDeleteAssignment activity .
trying to calculate the handle of a class whose instances may not be written to the database: Work-: code: SQLState: Message
Option 1: call pxDeleteAssignmentsForWork activity to cleanup all flows/assignments that were instantiated through StartFlow activity (which is not a best practice :))
Option 2: Why don't you create Optional process instead of Local action for Manager to perform where first assignment will be to manager (with same flow action as local action) and then split for each doing the same thing that you are doing the activity. With this approach you will need to call pxChangeStage explicitly.
Option 3: Use tickets. Set ticket on end shape of the subprocess that you are starting through activity and Raise ticket when manager finishes his assignment.
option 1 ; This option doesn't work in our case as needed to delete particular assignment on fly. Despite of successfully deletion of assignment, Ended up with other issue as mentioned above .
First, Optional process is restricted to stage level ,Hence needed additional conditions to control the visibility of it when the same user has other tasks on same stage .
Major concern with optional process in this situation ,The Task gets created as soon as operator initiates an optional process.Let's assume the situation where operator just click on cancel on task as he don't want to proceed with optional process ,therefore we ended up with an additional task Optional process isn't flexible as having with local action untill needed additional task for different user (through an assignment or Case )
Option 3:- Ticket approach is Perfect resolution in our case rather than my own work around approach as keep the wait shape and play around with work status .