Skip to content

Assign a Task to a Manager

Scenario

Use this example when the next task should automatically go to the manager of the selected person or initiator.

Prerequisites

  • permission to create processes and roles
  • organisation data with manager relationships already defined
  • access to role expressions in the process designer

Steps

Create the Process and Tasks

  1. Create a process and open it in edit mode.
  2. Build two tasks:
  3. the initial form task
  4. Manager Approval
  5. Add Approve and Reject actions to the manager task.
  6. Route Reject back to the first task if you want resubmission.

Process diagram with the manager approval task and return route.

Create the Manager Role

  1. Add a new role named Manager.
  2. Set the role type to Expression.
  3. Choose JavaScript as the expression language.
  4. Use a manager lookup expression such as:
1
$Membership.FindManager($Xml.Evaluate('PersonnelInformation/Personnel'));

This expression routes the task to the manager of the identity selected on the form. If your design should instead use the process initiator, you can adapt the expression accordingly.

Role expression editor with manager lookup logic.

Assign the Role to the Task

  1. Return to the process designer.
  2. Select the Manager Approval task.
  3. Choose the Manager role in the task settings.

Task configuration showing the manager role assigned to the approval task.

Test the Process

  1. Commit the process changes.
  2. Start the process from the folder.
  3. Submit the first task with a selected person.
  4. Verify that the approval task appears for that person's manager.

Result

The approval task is now routed automatically to the manager resolved from organisation data.