...
This section is used by the Manager to approve or deny the leave request. We will set up the Quick View feature so that the Manager will have a quick way to approve or reject the task from their Task List when we create the Leave Approval workflow. This is convenient particularly if this part of the workflow is performed on a mobile device. An Approval control is required for this feature. An Approval control is a section that contains only one textarea control and can be optionally set up for a digital signature. Follow these steps to create the Approval control so we can incorporate the Quick View feature when we create the Leave Approval workflow:
...
- We first get the name of the current step (activitystep).
- If the step name is Employee and the Employee ID is blank, we'll initialize several fields as shown below. If the Employee ID already contains a value (e.g. if the Manager sends it back to the Employee for corrections), we do not wish to overwrite the data.
- If the step name is Employee, we also want to hide the Manager Approval and HR sections. This will happen automatically if the user does not have the Manager role but remember that Managers are also Employees and might request leave that must be approved by their supervisor.
- The rule also contains initializations to be performed in the Manager and HR steps of the workflow.
...
Code Block | ||
---|---|---|
| ||
if (form.load) { var an = _data.getParameter("flow.activitystep.name"); if (an === 'Employee') { EId.value = _data.getParameter('subject.id'); // Username EFullName.value = SubjectUtil.getFullName(_data.getParameter('subject.first.name'), _data.getParameter('subject.last.name')); EEmail.value = _data.getParameter('subject.email'); MId.value = _data.getParameter('subject.reports.to'); } else if (an === 'HR') { HFullName.value = SubjectUtil.getFullName(_data.getParameter('subject.first.name'), _data.getParameter('subject.last.name')); HEmail.value = _data.getParameter('subject.email'); } } |
...
- Create a new flow by clicking on the Flows menu item and clicking the New button.
- Drag and drop the Leave Approval form you just created into the flow. This creates a step (activitystep) in the workflow.
- Name the activity step 'Employee' by typing the name in the Name property.
- In our example, we will use the same form three times, once for the Employee, Manager and HR.
- Select the Employee activity step and click the icon twice.
- This will create two linked steps. A linked step refers to the same form as the original step. The form cannot be edited from a linked step but any edits made to the original form are reflected in the linked steps.
- Name the second activity step Manager and the third activity step HR.
Setup roles/users for steps
...
If you prefer, you can click the toolbar at the top of the Flow Designer and set the Pending Msg property for the flow as a whole. This will be used if there is no activitystep-specific Pending Msg.
[Optional] Set history message
...
The Manager can quickly accept/reject tasks by clicking the Quick View icon for a task when accessing the Task List. Set up this feature for the Manager Approval step in this flow. Click on the Manager step and then click the Setup/Approval/Rejection link on the Property pane. Be sure to check the Enable box and then compose a Summery of the task that will be seen on the Manager's Task List. You can select controls in your flow from the Control dropdown and then click the Insert into Summary button to add these fields as templates. The Approval Control dropdown will provide a list of all the sections in your form that meet the Approval Control criteria. Refer to this documentation for more information on this feature.
[Optional] Customize notification emails
...
When a workflow step must be performed by someone else e.g. the Manager, a task is generated and placed on one or more users' task lists. You can customize the name of the task that is displayed either for each activity step individually or for the flow as a whole.
...
- On the Flows Home page, click the Test button for your workflow. will display the first step in the workflow. This is the Leave Approval Request form to be filled in by the Employee. The Employee Information section should be automatically populated.
- Fill in the Start Date and Number of days. Select Sick Leave for the type of leave to see if the hidden certificaiton certification field displays. Check another type of leave to verify that the Sick Leave Certification field is again hidden.
- Enter a comment, Sign the form and click the 'Submit Request' button.
- Since the second step in the flow was assigned to the user identified by the {MId} field, will create a new task and put it on that user's task list.
- will also notify that user that there is a new pending Leave Approval request (these notifications can be turned on/off by individual users). The email address for the user is obtained from that user's profile.
- Finally, will display the Pending Msg that was configured 'Your request has been forwarded to your Manager for approval.' on your screen.
- Logout as the designer user.
...
- Check the email account assigned to the user with the HR role (Hanna) and click on the link in the notification email. Login as Hanna.The Quick View feature is not configured for this activity step of the flow so only the Manager Approval and HR sections of the Leave Approval request form will display based on the roles assigned earlier.
Click the icon to view the Audit trail for the flow. The audit trail contains information for steps performed by the designer and the manager visible at a glance assuming you setup the History Msg as described above. If you did not setup the History Msg, you will not see it in the Audit Trail, Hanna reviews the information and fills out any required fields, then clicks the 'Sign this section' button to digitally sign the form.
- Click the Finish button to complete the workflow.
The Form and Doc actions will now be performed: you will see the display message that you configured, a PDF will be saved to your Google Drive or to ImageSilo/PVE as configured and an email will be generated and sent to the original requester with the pdf attached.
...