Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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
languagejavascript
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

...

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.

...

  • 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.

...