Class: GetNextTask

GetNextTask

A GetNextTask control provides the following configuration properties in Process Designer:
Behavior
Get Next Service: AJAX Service Service Reference
Events
On Load:
Description: Triggers whenever the view is loaded.
Example:
me.requestNextTask();
On Request Complete:
Description: Triggers upon successful retrieval of next task.
Example:
${TaskUIFrame}.loadTask(me.getTaskId());
On Request Error:
Description: Triggers if a request for the next task results in an error.
Example:
console.log("Error: " + me.getError().errorCode + me.getError().errorText);

new GetNextTask()

This constructor is never used explicitly.

Extends

  • com.ibm.bpm.coach.CoachView

Methods

getError(){Object}

Gets the error associated with the most recently requested task, if there is one. Structure of this object, as well as information contained within it, will depend on the specific AJAX implementation
Returns:
Type Description
Object

getResult(){Object}

Returns an object containing information about the last requested task, including instanceId and taskId
Returns:
Type Description
Object

getTaskId(){string}

Get the Task Id of the last requested task
Returns:
Type Description
string

requestNextTask(mode, name, proritizeOnDueDate, context)

Loads information about the next task into the control
Name Type Default Description
mode string The mode used to select the next task. Acceptable values are "user", "role", "group", "participant", "team", and "pg"
name string Name to use for the search. This should be based on the mode used. If mode is "user", this defaults to the login name of the current user.
proritizeOnDueDate boolean false optional Whether or not to prioritize the search based on the due date. If false, priority will be based on task priority
context ANY optional Add additional context information to aid in the selection of the next task. To be used with custom AJAX selection services.
Examples
${GetNextTask1}.requestNextTask("user"); // will load the next task for the current user based on task priority
${GetNextTask1}.requestNextTask("user", "jdoe", true); // will load the next task for the user jdoe based on the next task due
${GetNextTask1}.requestNextTask("role", "Human Resources"); // loads the next task available for members of the "Human Resources" BPM group
${GetNextTask1}.requestNextTask("team", "Developers"); // loads next task available to members specified in the "Developers" BPM team