Working with Step Assignee

Setting Step Assignee

User can set different types of Step Assignee:

  • Users
  • Field (assignee IDs are got from Data Source Object record fields)
  • Group
  • Chatter Group
  • Queue
  • Role
  • Profile
  • Permission set
  • Variable (assignees are got from variable)
  • Apex class
  • Query (assignees are returned as a result of database query, available from version 5.0)
  • Resource (available from version 6.0)
  • Resource Pool (available from version 6.0)
  • System (Automatic)

User can set or change Step Assignee in these places:

  • Process builder (Responsibility) - in Responsibility Properties sidebar
  • Responsibility Override - in Step properties sidebar
  • Process details - in the "Assignee" tab of Progress Component. Need to enable Assignee tab in Step Properties.
  • Task Manager (Kanban) - on "Assignee" tab of card layout. Need to enable Assignee tab in Step Properties.
  • Escalation - step can be escalated to another assignee by Escalation or Duration Expiration Handler.
  • Actions - by calling proper method of Apex class (e.g., WorkflowService.changeAssignee() method).
User(s) as Step Assignee

Go to Responsibility or Step "Properties" and select "User" as "Assign Type" (1):

Click "Add Users" link (2) to show a popup with users picker (3). Select one or more users (up to 10) by simple mouse clicking (selected users will be highlighted with light blue):

Note: type part of user name and click "Search" button (4) for quick filtering.

Click "Add" button. Added users will be shown under "Assign Type" field:

Click "Remove User" button (5) to get rid of unneeded assignee.

Field as Step Assignee

Select "Field" as "Assign Type" and click "Add Fields" button (6) to call a Fields Picker (7):

Select necessary field(s) (up to 5) by mouse clicking and click "Add" button. The added fields will be shown under "Assign Type":

Group, Chatter Group, Queue, Role, Profile, Permission set, Resource and Resource Pool  as Step Assignee

Select one of these types in "Assign Type" field and click proper "Add..." link to show proper picker (8):

Select a Group / Chatter Group / Queue / Role / Profile / Permission set  (only one can be selected) or Resource / Resource Pool (up to 10) and click "Add" button. The selected assignee(s) will be shown under "Assign Type":

Note: Groups, Chatter Groups, Queues, Roles, Profiles, Permission sets, Resources and Resource Pools should be properly configured before they can be used here.

Variable as Step Assignee

Select "Variable" in "Assign Type" field and click "Add Variable" link to show variables picker (9):

Select a variable (only one allowed) and click "Add" button. Selected variable will be shown under "Assign Type" field:

Note: variable should be defined somewhere in process builder (e.g., on "Define Variable" step action) before it can be used here.

Apex Class as Step Assignee

Select "Call Apex" in "Assign Type" field and click "Add Apex Class" link to show classes picker (11):

Select necessary class and click "Add" button. Selected lass will be shown under "Assign Type":

Apex class should implement WR_BPM.WorkflowAssigneeInterface method.

Execute method should return string with assignee id(s). It can be single user id, multiple users ids (comma separated), profile id, role id etc.

Example:

Based on Responsibility name code below defines different assignees for each Responsibility:

global with sharing class WR_ApexAssignees implements WR_BPM.WorkflowAssigneeInterface {
     public String execute(sObject context, WR_BPM__Flow_Instance_Cursor__c flowInstanceCursor, WR_BPM__Flow_Step_Junction__c step)
     {
        if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility A')
        {
            // code to query assignee data
            // process name is: WR_BPM__Flow__r.WR_BPM__Process__r.Name
            // version (flow) name is: WR_BPM__Flow__r.Name
            return '0056A000000YP12';
        }
        else if (step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility B')
            return '0056A000000YP1M,0056A000000YP12';
        else if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility C')
            return '00e6A000000E1aG';
        else if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility D')
            return '00G6A000000LjpX';
        else
            return null;
     }
}
Query as Step Assignee

Available from version 5.0

Select "Query" as "Assign Type. By default query conditions are not set, so, click "set" link (12) to show "Edit Query Conditions" popup (13):

Set necessary query conditions (14) and click "Apply" button (15). Query information will be shown under "Assign Type":

Click "Edit" link (16) to change Query conditions.

Resource and Resource Pool
System as Step Assignee

Responsibility or step can be assigned to system for automatic processing.

To make Responsibility system just check "System" checkbox (17):

and confirm this in the popup appeared:

To make particular step system (automatic) select proper option (18) in the "Step Type" picklist:

Also step can be added as automatic initially by dragging proper shape from "Elements" section of left sidebar.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.