Approval record getting cancelled prematurely
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2012 02:08 PM
I have a workflow with 3 approval workflow activities (see attachment), called Level 1, Level 2 and Level 3 approvals that is kicked off from the Change Request form. All of the approval records are created at the same time, allowing any approver to approve at anytime, rather than waiting for the Level 1 approver to approve before creating the Level 2 approval record, etc. The approver in each record is determined by a lookup to the Group form where we store who is Level 1, 2 and 3 managers
The problem I'm running into is when one of the group's managers change. For example, the Change is submitted for approval and all three approval records are created based on the workflow activities: Level 1 for Person A, Level 2 for Person B, and Level 3 for Person C. The approval records for Person A and Person B both go to Requested status, which is appropriate.
While the approval records are still in Requested status, the Level 2 manager of the group changes to Person X.
Person A then processes their approval record and it gets marked Approved
The approval record for Person B gets deleted (which I think is OK since the manager changed), and an approval record for Person X is created, but it immediately goes to Cancelled status and the workflow continues on What I need to happen is for the Person X approval record to stay in Requested status.
It feels like the processing may be too fast in the workflow. As if its already processing the run script that cancels any optional approval records before the new approval record for Person X can be fully created, but I don't know if this actually what is happening or if there is a way to stop it from cancelling the record.
Thanks for your help
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2012 07:25 AM
Hi,
Are you trying to change the approver for person B directly? or creating a new approval record?. I think this is an out of box behaviour. i would suggest you add up one if condition in your workflow and a business rule on approval table. Let me explain
1) Business rule : This will keep track whether an approval has been changed or not and based on that, it will set a flag(or basically dictionary entry along with the new approver name(sys_id) ) on the change_request table. You can create a string field and set flag as "1,
2) IF condition : This will check whether the above flag is set. If the flag is set then it will loop back to the same approval activity in the workflow. Here In the script of the workflow, check if the flag is set then send the new approver name for the 2nd approver.
Hope this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2012 07:27 AM
I also see that one run script "set optional to cancelled" may be setting your approvals to cancelled state. Check it once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2012 06:15 AM
It is a new approval record that is created, the old one gets deleted. I also think that it is OOB behavior. What I find odd is that it creates the new record in 'Requested' state, but then changes it almost immediately to 'Cancelled'. I even tried removing the 'set optional to cancelled' activity from the workflow and this still happens.
I was hoping to fix this without adding a new field to the form, but I'll give that a try. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2012 09:46 AM
I did some more testing on my instance and Demo and what I found is the reason the new approval record is getting Cancelled is because the workflow is completing. Basically, when the first approval record is completed, the second one is then deleted and recreated, but during this time, the workflow continues on and reaches the end. If there was something else in the workflow, like creating a task, the workflow would not complete and the approval record would stay in 'requested' status. However, once that task is completed, the new approval record is cancelled, if its not yet been approved.
The first question I have is why is it creating the new approval record if its just going to bypass it.