Versions Compared

Key

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

...

  1. Login to as the administrative user for your tenant.
  2. On the page that is displayed, click the 'Manage Users' link.
  3. In the Alphabet at the top click All to display a list of the users in the tenant. If the users shown in the company org chart above are not listed, perform steps 4 - 8 to add them.
  4. For each user, click the  icon to add a new user profile.
  5. In the form that's displayed, fill in the information for each user shown in the company org chart shown above.
  6. Be sure to select the role specified in the company org chart for each user.
  7. Select the user's Manager from the Reports To drop down.
  8. Click "Submit" to add the user.
  9. If you are using Active Directory or LDAP, you do not need to do this.

...

Create the Leave Approval

...

form

Tip
Read the general documentation on designing flowsforms for a detailed discussion of workflows and their features

Setup the steps in your workflow

Image Removed

  • Create a new flow by clicking on the Flows menu item and clicking the New Image Removed button.
  • Drag and drop a New Form into the flow. This creates a step (activity) in the workflow.
  • Name the activity '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 and click the Image Removed icon twice.
  • This will create two linked activities. A linked activity refers to the same form as the original activity. The form cannot be edited from the linked activity but any edits made to the original form are reflected in the linked activity.
  • Name the second activity Manager and the third activity HR.
  • For the first activity, set the role Employee.
  • For the second activity, we require that it is performed by the Employee's Manager (specific person rather than a role). We'll set this up later.
  • For the third activity, set the role HR

Create the Leave Approval form

Tip
Read the general documentation on designing forms for a detailed discussion of and their features. In particular, make sure you understand the Name property of a control. You can find more information in this documentation.

The form consists of four sections as described below.

Employee Information Section

Image Removed

View the Form Layout Video to learn more about laying out form controls.

  1. Drag and drop controls as shown in the image above.
  2. We have created a section with Employee information containing controls Id, Manager Id, Name, and Email.
  3. Make sure that the Name field of each control is properly set. This is a critical step to ensure that business rules work. The controls are named as shown in the table below. Make sure that the Control Name field is exactly as shown below including case-sensitivity. You may label the controls whatever you want.
  4. Uncheck the Enabled checkbox for each control and check the Required checkbox. The control values will be automatically filled in by a business rule.
Control Label Control Name Description
IdEldThe login id of the currently logged in Employee (user)
Manager IdMIdThe login id of the current user's Manager
NameEFullNameThe current user's full name
EmailEEmailThe current user's email address

Leave Request Section

Image Removed

This section is filled in by the Employee who is requesting the leave.

  1. Drag and drop controls as desired.
  2. We've placed Start Date, Number of Days, Type of Leave, Certification and Comments controls as shown.
  3. Select the section by clicking on its header.
  4. In the properties panel, select the Security Tab.
  5. This is considered a Signed Section. Two types of signatures are available from the Signature drop down: Text/Signature Image or Wet Signature. Here is information about the difference between the signature types. Select Wet Signature from the dropdown. 
  6. Check the Must Sign checkbox to require the signature and verify that the Lock checkbox is checked to prevent tampering with the signed data .
  7. Notice that a "Sign this section" button and an X with a line appear at the bottom right and left of the section when the signature type is selected. 
  8. The Employee will have to sign the section before it can be submitted.
  9. Select the Security Tab.
  10. Select the Employee role from the role dropdown.
  11. Do not forget to uncheck the Visible checkbox on the Certification field. This field is not visible on the form unless the Employee selects Sick Leave as the Type of Leave. This will be handled by a rule that will be discussed later in the tutorial.

Manager Approval Section

Image Removed

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. 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 text/textarea control and can be optionally set up for a digital signature. Follow these steps to incorporate this feature in your flow:

  1. Drag and drop a Section control. Name the section Manager Approval.
  2. Add a text area control with 3 lines and name the control Comments.
  3. Select the section by clicking on its header.
  4. In the properties panel, select the Security Tab.
  5. In the Roles multi-select, select the roles Manager and HR. This section will only be visible to the Manager and to the subsequent HR reviewer.
  6. Select Text/Signature Image from the signature dropdown. As before, check the Must Sign checkbox to require a signature and verify that the Lock checkbox is checked to prevent tampering with the signed data .

HR Review Section

Image Removed

This section is for the HR reviewer and is similar to the Manager approval section.

  1. Drag and drop text controls for HR name and email.  We've labeled the controls Name and Email but the Name property of the control contains HFullName and HEmail. Once again, the form will fill in this control automatically. We'll use the value from this control to create a meaningful audit trail for the workflow.
  2. We've also added an optional Comments field.
  3. As before, in the Security Tab, select the HR role to restrict viewing of this section to HR Employees.
  4. Select Text/Signature Image from the Signature dropdown and check the Must Sign checkbox to make the signature required.

Business Rules

Open the Flow Designer, edit the Leave Approval Flow, click on the form named Employee, edit the form by clicking on the Image Removed icon, create a rule to initialize the form and a second one to make the Certification control visible when Sick Leave is selected as the Type of Leave. The Rule Validator can help troubleshoot any issues with rules.

Our form contains two business rules: the first one automatically initializes various fields in the form and hides irrelevant sections. This rule is shown below:

  • We first get the name of the current step (activity).
  • 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.
Note

It is very important to ensure that the Names of the controls in the form exactly match the names used in the rule below and that the names used in a rule are unique across the form.

Here is an example of a rule that will satisfy the four requirements listed above:

Code Block
if (form.load) { var an = _data.getParameter ("flow.activity.name"); if (an === 'Employee' && EId.value.length === 0) { // User Information EId.value = _data.getParameter('subject.id'); // Username EFullName. In particular, make sure you understand the Name property of a control. You can find more information in this documentation.

The form consists of four sections as described below.

Employee Information Section

Image Added

View the Form Layout Video to learn more about laying out form controls.

  1. Drag and drop controls as shown in the image above.
  2. We have created a section with Employee information containing controls Id, Manager Id, Name, and Email.
  3. Make sure that the Name field of each control is properly set. This is a critical step to ensure that business rules work. The controls are named as shown in the table below. Make sure that the Control Name field is exactly as shown below including case-sensitivity. You may label the controls whatever you want.
  4. Uncheck the Enabled checkbox for each control and check the Required checkbox. The control values will be automatically filled in by a business rule.
Control Label Control Name Description
IdEldThe login id of the currently logged in Employee (user)
Manager IdMIdThe login id of the current user's Manager
NameEFullNameThe current user's full name
EmailEEmailThe current user's email address

Leave Request Section

Image Added

This section is filled in by the Employee who is requesting the leave.

  1. Drag and drop controls as desired.
  2. We've placed Start Date, Number of Days, Type of Leave, Certification and Comments controls as shown.
  3. Select the section by clicking on its header.
  4. In the properties panel, select the Security Tab.
  5. This is considered a Signed Section. Two types of signatures are available from the Signature drop down: Text/Signature Image or Wet Signature. Here is information about the difference between the signature types. Select Wet Signature from the dropdown. 
  6. Check the Must Sign checkbox to require the signature and verify that the Lock checkbox is checked to prevent tampering with the signed data .
  7. Notice that a "Sign this section" button and an X with a line appear at the bottom right and left of the section when the signature type is selected. 
  8. The Employee will have to sign the section before it can be submitted.
  9. Select the Security Tab.
  10. Select the Employee role from the role dropdown.
  11. Do not forget to uncheck the Visible checkbox on the Certification field. This field is not visible on the form unless the Employee selects Sick Leave as the Type of Leave. This will be handled by a rule that will be discussed later in the tutorial.

Manager Approval Section

Image Added

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. 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 text/textarea control and can be optionally set up for a digital signature. Follow these steps to incorporate this feature in your flow:

  1. Drag and drop a Section control. Name the section Manager Approval.
  2. Add a text area control with 3 lines and name the control Comments.
  3. Select the section by clicking on its header.
  4. In the properties panel, select the Security Tab.
  5. In the Roles multi-select, select the roles Manager and HR. This section will only be visible to the Manager and to the subsequent HR reviewer.
  6. Select Text/Signature Image from the signature dropdown. As before, check the Must Sign checkbox to require a signature and verify that the Lock checkbox is checked to prevent tampering with the signed data .

HR Review Section

Image Added

This section is for the HR reviewer and is similar to the Manager approval section.

  1. Drag and drop text controls for HR name and email.  We've labeled the controls Name and Email but the Name property of the control contains HFullName and HEmail. Once again, the form will fill in this control automatically. We'll use the value from this control to create a meaningful audit trail for the workflow.
  2. We've also added an optional Comments field.
  3. As before, in the Security Tab, select the HR role to restrict viewing of this section to HR Employees.
  4. Select Text/Signature Image from the Signature dropdown and check the Must Sign checkbox to make the signature required.

Business Rules

Open the Flow Designer, edit the Leave Approval Flow, click on the form named Employee, edit the form by clicking on the Image Added icon, create a rule to initialize the form and a second one to make the Certification control visible when Sick Leave is selected as the Type of Leave. The Rule Validator can help troubleshoot any issues with rules.

Our form contains two business rules: the first one automatically initializes various fields in the form and hides irrelevant sections. This rule is shown below:

  • We first get the name of the current step (activity).
  • 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.
Note

It is very important to ensure that the Names of the controls in the form exactly match the names used in the rule below and that the names used in a rule are unique across the form.

Here is an example of a rule that will satisfy the four requirements listed above:

Code Block
if (form.load) {
  var an = _data.getParameter ("flow.activity.name");
  if (an === 'Employee' && EId.value.length === 0) {
    // User Information
    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');
    ManagerApproval.visible = false;
    ManagerApproval.required = false;
  } else if (an === 'HR' && MFullName.value.length === 0) {
    MFullName.value = SubjectUtil.getFullName(_data.getParameter ('subject.first.name'), _data.getParameter ('subject.last.name'));
    EEmailMEmail.value = _data.getParameter('subject.email');
    MId.value = _data.getParameter('subject.reports.to');
    ManagerApproval = _data.getParameter('subject.email');
  }
}

Add a second rule to make the Certification field visible when Sick Leave is selected as the Type of Leave:

Code Block
if (TypeOfLeave.value === 'Sick') {
  Certification.visible = falsetrue;
    ManagerApprovalCertification.required = falsetrue;
  } else if{
(an === 'HR' && MFullName.value.length === 0) {
  Certification.visible = false;
  MFullNameCertification.valuerequired = SubjectUtil.getFullName(_data.getParameter ('subject.first.name'), _data.getParameter ('subject.last.name'));
    MEmail.value = _data.getParameter('subject.email');
  }
}

Add a second rule to make the Certification field visible when Sick Leave is selected as the Type of Leave:

Code Block
if (TypeOfLeave.value === 'Sick') {
  Certification.visible = true;
  Certification.required = true;
} else {
  Certification.visible = false;
  Certification.required = false;
}

...

false;
}

When you are satisfied with the rules, click the Finish button to save the Rules and then again to save the updates to the flow and return to the Flow Designer. We're now done with the form.

Creating the Leave Approval Workflow

Tip

Read the general documentation on designing flows for a detailed discussion of workflows and their features

Setup the steps in your workflow

Image Added

  • Create a new flow by clicking on the Flows menu item and clicking the New Image Added button.
  • Drag and drop a New Form into the flow. This creates a step (activity) in the workflow.
  • Name the activity '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 and click the Image Added icon twice.
  • This will create two linked activities. A linked activity refers to the same form as the original activity. The form cannot be edited from the linked activity but any edits made to the original form are reflected in the linked activity.
  • Name the second activity Manager and the third activity HR.
  • For the first activity, set the role Employee.
  • For the second activity, we require that it is performed by the Employee's Manager (specific person rather than a role). We'll set this up later.
  • For the third activity, set the role HR

Setup roles/users for activities

...