Views: 3088
Last Modified: 06.09.2021

Example: supervisor is on a vacation

Below is the example of using Select Employee activity. Use it for selecting a supervisor who will approve an element. When the supervisor is on a vacation, the system selects a supervisor, one step higher in seniority and etc. Following this logic the activity reaches the CEO or selects no supervior at all (in case if management is missing altogether), assigns a deputy supervisor.

Sequence of activities

  • Create new template, with 2 User variables inside:
    • Supervisor, updates during workflow progress;
    • Deputy is practically a permanent variable, modified manually when deputy is on leave or vacation. Indicate a default employee that will approve an element in case supervisors are missing.
  • First, add a Select Employee activity. In parameters, indicate , the direct supervisor for the Author with missing employee skipped.
  • Add an Edit variable activity. Indicate variable in parameters , as Supervisor via Select employee (Insert Value] - Additional Results - Select Employee - Selected Employee).
  • Add a Condition construction and create 3 branches in it. Condition numbering is the same as the activity's performance sequence: from left to right.
    1. Define the condition in the first branch for deputy to be assigned instead of selected CEO. Indicate CEO in the lowest condition and then add an activity Edit Variable. Inside it, indicate , the Supervisor variable as equal to Deputy.
    2. Define the condition inside the second branch for the deputy to approve the document in case when the complete management is unavailable. Indicate inside the condition . , the Supervisor variable as empty Due to Select employee activity returning an empty value for selected employee, if none of supervisors was selected (for example, all management is unavailable). . Now, add the Edit variable activity, configured in the same manner as the previous branch. Next, add notification about completely unavailable management.
    3. We do not change employees in the last branch, which results in Supervisor variable remains equal to the Select Employee activity result.

Finally, the template looks as follows:


0


Courses developed by Bitrix24