AVIO Consulting

Dynamically Assigning an Oracle PCS Task to an Application Role

Oct 12, 2017 | BPM, Oracle

Instead of using the default process swimlane Application Roles to assign a task to people, the Oracle Integration Cloud’s Process Cloud Service (PCS) processes can be made more flexible and reusable when a User task in a process is set to be performed by different people dynamically. 

In this process below, the swimlane role named “Dynamic Assignee” could have been named anything and have no one assigned.  At runtime when a work item instance enters the “Approve Supplier” User activity, the swimlane role is ignored, and a value passed into the process is instead used to dynamically assign the task to different people.  In this case, the value a data object element is set to the text of the ID of an Application Role somewhere upstream of the process. 

 

Process with a User Task Dynamically Assigned

In the example below, the value that is in the data object element named Supplier.applicationRole contains the ID of the Application Role in the selected activity’s property panel.

 

Data Object Element for the Dynamic Assignment

It is not obvious, but the value set in this data object element needs to be the ID of the application role.  The mistake that is commonly made is to use the name shown when you click Manage Roles under Configure in PCS as shown below.

Manage Roles option does not provide the ID needed for dynamic assignment

Although this is the name of the application Role, it is very frequently not the text you need to use to assign a task using a data object element’s value.  If this text is used, at runtime this error will occur when the task reaches the activity in the process.

Invalid task assignment runtime error

Instead, to determine the Application Role’s ID, open any User task’s properties dialog in the application.  Beside the Assignee(s) property, click the edit button.

Select the Edit button beside the Assignee(s) field

Select Names and Expressions from the top dropdown -> click the + button -> select Add Shared Role.

Select Shared Role

Beside the Value field, click the search icon.  This list of Application Roles will likely be quite long, so type in the first few characters of your application’s name and click the Search button.  As shown below, select the Application Role.

Select the Application Role

Copy the text beside “Details” (and not the “Name”).

Copy the ID's text

When setting the data object element’s value upstream in the process, surround it with double quotes and use this text in the data association.

Set the Application Role text for the downstream dynamic assignment