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.

What You Will Learn

  • resolve a manager through a role expression
  • assign the resolved role to an approval task
  • verify task ownership with organisation data

Difficulty and Estimated Time

  • Difficulty: Intermediate
  • Estimated time: 15 minutes

Assumed Knowledge

You should be familiar with roles, process data paths, and JavaScript expressions.

Required Reading

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.

Verify the Result

Start the process as a user with a configured manager and confirm that the manager receives the approval task. Repeat with a test user who has no manager and confirm that the process follows the documented fallback or reports a clear configuration error.

Security and Portability Notes

  • Resolve the manager from organisation data in the current domain; do not copy a manager user ID between domains.
  • Define an explicit no-manager outcome so an instance cannot become silently unassigned.
  • Confirm that the resolved manager is authorised to see the form data before using this pattern with sensitive data.

What to Learn Next