Workflow Series I
Hi Readers,
In the workflow series, we look at various scenarios and how we can set them up in the workflow
Scenario
Approvers | Scenario |
Manager 1 | Any of the 3 managers can approve the document to release it |
Manager 2 | |
Manager 3 |
For my workflow series , I will be using the Workflow User Group type of approval.
1.To set up workflow user groups, search for Workflow User Groups.
2. In the window that appears click on New to set up the group.
3. For our scenario, I have set up the managers as below
The Sequence No refers to the order/level of approval. I have set all of them to a sequence of 1, meaning that either of them can approve the document as they are all on the same level.
I head over to my Workflows. For this scenario, i will use a sample template of a purchase order.
1.Search for Workflows
2. Create a new workflow from an existing template
3. The system has created a workflow from the template as shown below
I need to link the workflow with my workflow user groups which contains the approvals.
1.Click on the list of responses for raising an approval as shown below
2. In the list that appears, highlight the line that contains the response for creating the approval request. In the options below the page, change the Approver Type to Workflow User Group. On the Workflow User Group Code, pick the specific Workflow User Group Code we created.
3. Enable the workflow.
I will now create the P.O , send it for approval and assume the role of an approver to approve the P.O.
After approving the P.O, we can note that i have two issues:
1.In my approval entries for the PO as shown below, only one entry has been approved. This is an issue because because all the approval entries' status have to be Approved
2. The status of the PO document remains at Pending Approval instead of Released.
So do we do the fix our workflow? We have to do 2 things:
Fix 1 : Sorting the Pending Approvals
In the workflow, we notice there is a section that is controlled by the number of Pending Approvals.
We may ask where the Pending Approvals are located?
In the approval entries, we have a hidden field called Pending Approvals which checks the number of approvals left in a particular's document approval. As shown below we have 2 pending approvals.
So how does it work?
Lets explore this specific line below
This line means that if the Pending Approvals are greater than zero in an approval chain and an approval user approves the document, the response should send an approval request to the next person in the sequence. See example below
Approvers | Sequence | Scenario |
Sender of Approval |
The sender of approval send the approval. Pending Approvals : 3 |
|
Manager 1 | 1 |
The manager approves the request. Pending Approvals now : 2 The response will check and see the pending approvals are > 0, so it will send an approval request to the next person in sequence -> 2 |
Manager 2 | 2 |
The manager approves the request. Pending Approvals now : 1 The response will check and see the pending approvals are > 0, so it will send an approval request to the next person in sequence -> 3 |
Manager 3 | 3 |
The manager approves the request. Pending Approvals now : 0 The response will check and see the pending approvals are equal to 0, so it will ignore that particular line on approval. |
So do we really need this line? No, because all our approvers are on one sequence. We will delete it
Lets explore another line
This line means that if the Pending Approvals are equal to the zero the system should change the status of the document from Pending Approval to Released.
However in our case, our pending approvals will never be zero because only one approver is required. So we need to remove that filter of zero.
Click on the Conditions of that line as shown below to edit the filter
Remove the zero on the Pending Approvals filter and click on Ok
Our workflow should now look like below
This should resolve the issue of changing the status of the document to Released if any manager approves.
Fix 2 : Sorting the Approval Entries once a manager approvers
We can remember that if any manager approves , only one approval entry is approved as seen below
So how do we make the system to change al the approval entries to approved once any manager has approved?
Click on the responses to the second line as shown below
In the window that appears , add a response called 'Approve the approval request for the record' as shown below
This response will change all the approval entries to Status Approved if any manager approves the record.
Enable the workflow and lets re-test again.
Our purchase order status is now Released after approval by one manager
All our approval entries are now approved.
The system also allows you to know which user approved the record using thre Last Modified By User ID field
The above shows me which manager approved all the 3 records for audit purposes.
This should work for all approvals where the sequence number is 1 irrespective the number of approvers e.g 5 managers where either can approve
We shall check more of these scenarios in next posts.