Dynamic Assignment and Task Escalation Patterns

When tasks are assigned to a group, application role, or list of users a single user must claim a task to act on it. However, you can also automatically send work to users by using various dispatching mechanisms.

Automatic task dispatching is done through dynamic assignment patterns. Dynamic assignment patterns select a particular user or group from either a group or a list of users or groups. Similarly, when a task is escalated, a task escalation pattern can be used to determine the user to whom the task should be escalated to. Several patterns are provided out of the box. However, you can also create your own patterns for dynamic assignment and task escalation and register them with the workflow service. Table 34-21 describes the three dynamic assignment patterns and one task escalation pattern that are provided out-of-the-box.

Table 34-21 Dynamic Assignment Patterns

Assignment Pattern Type Description

LEAST_BUSY

Dynamic assignment

Picks the user or group with the least number of tasks currently assigned to it.

MOST_PRODUCTIVE

Dynamic assignment

Picks the user or group that has completed the most tasks over a certain time period (by default, the last seven days).

ROUND_ROBIN

Dynamic assignment

Picks each user or group in turn.

MANAGERS_MANAGER

Task escalation

Picks the manager's manager.

These patterns all check a user's vacation status. A user that is currently unavailable is not automatically assigned tasks.

Dynamic assignment patterns can be used when defining a task participant, as described in How to Configure the Single Participant Type. They can also be used with task-assignment rules allowing end-users to specify dynamic assignment of tasks to the members of groups that they manage, as described in How To Create Group Rules.

The dynamic assignment patterns can also be called by using an xpath function in any xpath expression in the task definition.

The signature of the function is:

hwf:dynamicTaskAssign(patternName, participants, inputParticipantType,
targetAssigneeType, isGlobal, invocationContext, parameter1, parameter2, ...,
parameterN)

The parameters are:

  • patternName: Mandatory. Name of the pattern to use

  • participants: Mandatory. The participant or participants to select the assignee from. Can be a string or element containing a participant name or a comma-separated list of participant names, or a set of elements containing participant names or comma-separated lists of participant names. Participants must all be of the same type.

  • inputParticipantType: Mandatory. The type of the input participants (user, group, or application_role)

  • targetAssigneeType: Mandatory. The type of assignee to select (user, group, or application_role). Value must match the context in which the function is being used (for example, must be user if dynamically selecting an owner user. If the inputParticipantType is user, the only valid value here is user.

  • isGlobal: Boolean value that indicates if the pattern should be assessed using tasks of all types, or just tasks of the same type as the current task. Optional - defaults to false.

  • invocationContext: String to uniquely identify where this function is being used. If not specified, a default context is assigned.

  • parameterN: Some dynamic assignment patterns allow parameters to be specified. The parameter values can be specified as name-value pairs, using an “=" character as a delimiter - for example, “TIME_PERIOD=7"

Example usages:

hwf:dynamicTaskAssign(“LEAST_BUSY","jcooper,jstein,mtwain","user","user","true","ErrorAssignee")

hwf:dynamicTaskAssign(“MOST_PRODUCTIVE",task:task/task:payload/task:users,"user","user","false","OwnerUser","TIME_PERIOD=7")

hwf:dynamicTaskAssign(“LEAST_BUSY","DeveloperRole","application_role","group"):

Before 12c Release 1 (12.1.3), dynamic assignment could be achieved by using the XPath functions wfDynamicUserAssign and wfDynamicGroupAssign. These XPath functions have been deprecated in 12c Release 1 (12.1.3). They can still be used, but Oracle recommends that you migrate any existing usage of these XPath functions to the new dynamicTaskAssign function.