Question
Cognizant
IN
Last activity: 23 Apr 2024 5:36 EDT
How to change stage of a case on rejection
I have a requirement where if the manager approves the case then the case should go to Director for approval but if he rejects the case it should come back to Review stage.
For this design i have configured an activity on reject button to set the property as IsReject == true and then calling pxChange stage in refresh this section action and passing stage name as Review but that is not working.Need help with this.
Note:I am not using the OOTB approval flow and I am using my own customised buttons as well for approve and reject in the section.
-
Reply
-
Jorge Castelan -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 8 May 2024 7:54 EDT
Maantic
IN
As I understand there are two possibilities either Approve (the case will follow the Manager Approval flow) or Reject (the case will jump off to the alternate stage).
You can set the flag on click of button (Approve/Reject) and do a finish assignment of your current assignment. After the assignment put a fork based on the flag proceed the case on Approval flow or Rejection stage.
If you need to capture some data in Rejection stage with the current Operator assigned the assignment to CurrentOperator.
Or there is another approach you can put the Reject Flow-action as flow-wide local action and display in the above mentioned assigned based on condition. From the Reject flow-action post action activity to call pxChangeStage and jump to the alternate stage. Reject flow-action can capture what you intend to capture in reject flow. In the alternate stage you can put a straight forward flow based on your reject data post capture and check delete open-assignments check box , with Resolved status if need to be Resolved.
Maantic Inc
IN
The error is displaying because the stage from where the pxChangeStage is being called is already present in the Review stage. The process cannot jump back to same stage. There is some issue in your logic. Before clicking the button, can you check in which stage the process is present at that point?
Cognizant
IN
@SohamM95 hi soham i did some changes in the logic now after setting the IsReject property to true i am calling the change stage activity and changing the stage to an alternate stage but there i am getting the error attached in the below pdf:even though i have configured the flow action on approval rejection stage
Maantic Inc
IN
Is there any assignment configured in the alternate stage? This usually happens when there's no assignment present or if its not assigned to the user.
Pegasystems Inc.
CA
Is the Cancel button customized in your flow? Also, I would advise the below items,
- passing the parameter for the change stage in double-quotes.
- To resolve the case (attached screenshots)
Thanks,
Updated: 17 Apr 2024 13:23 EDT
Cognizant
IN
@RameshSangili yes the cancel button is customised in my flow,
the stage name I was not passing as a parameter will try to so thanks but I don’t want to resolve the case I am again calling a change stage automation step to go back to the approval flow
Pegasystems Inc.
CA
Great! you found the the issue that stage name is passed in the parameter :) .
That's fine if your requirement is for the user to work on the rejection comments and submit them for approval again.
Cognizant
IN
@RameshSangili i tried to keep the pass the stage name as parameter in double quotes but that is still showing the same error.
Maantic Inc
IN
Did you check clean up process checkbox? Is there an assignment present in the flow of the alternate stage?
Maantic Inc
IN
Yes, and besides that the code seems to working fine.
Maantic Inc
IN
The change stage is working but your assignment logic is wrong in the alternate flow. How is it configured? Is it a screen or process flow?
Maantic Inc
IN
So the connector going out of the assignment needs a flow action to be assigned.
Cognizant
IN
@SohamM95 so when i am clicking on reject button ,i am calling change stage in the action set and in the alternate stage i have already configured the flow action on the connector
Maantic Inc
IN
Please provide screenshots of the flow and the configuration of the assignment and connectors.
Cognizant
IN
I am unable to add all the attachments so attaching the flow action configuration on the connector present on the assignment shape
Cognizant
IN
Maantic Inc
IN
Looks fine. When the flow action error is displayed, can you check in which place the process is standing?
Maantic Inc
IN
I mean to say the pxFlow page and the pyStageHistory list.
Accepted Solution
Updated: 8 May 2024 7:54 EDT
Maantic
IN
As I understand there are two possibilities either Approve (the case will follow the Manager Approval flow) or Reject (the case will jump off to the alternate stage).
You can set the flag on click of button (Approve/Reject) and do a finish assignment of your current assignment. After the assignment put a fork based on the flag proceed the case on Approval flow or Rejection stage.
If you need to capture some data in Rejection stage with the current Operator assigned the assignment to CurrentOperator.
Or there is another approach you can put the Reject Flow-action as flow-wide local action and display in the above mentioned assigned based on condition. From the Reject flow-action post action activity to call pxChangeStage and jump to the alternate stage. Reject flow-action can capture what you intend to capture in reject flow. In the alternate stage you can put a straight forward flow based on your reject data post capture and check delete open-assignments check box , with Resolved status if need to be Resolved.