Try OpenEdge Now
skip to main content
ABL Reference
Class Properties and Methods Reference : Assign( ) method (Progress.BPM.Task)
 

Assign( ) method (Progress.BPM.Task)

Instructs the OpenEdge BP Server to assign an available task to a given performer (a user).
When a task is created, it can be available or assigned. You may need to assign an available task or reassign an assigned task. In order for any work (including completion) to occur on a task, the task must be assigned to a user. If a task is available but not assigned, the Assign( ) method will assign the task to a specified user.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.BPM.Task class

Syntax

Assign ( INPUT name  AS CHARACTER )
The method succeeds if the task is available and can be assigned. If the method succeeds, it returns TRUE.
If the task is already assigned, the method fails and raises a BPM error.

Example

The following example shows the Assign( ) method for the Progress.BPM.Task class.
DEFINE VARIABLE oTask AS Progress.BPM.Task.
oTask = oUserSession:GetTask("ApproveCredit").
IF oTask:Status NE "I_ASSIGNED" THEN oTask:Assign("Mary").
In which:
*The task for the performer is to determine if credit should be approved.
*If the task is not assigned to anyone else, it is to be assigned to Mary.
An error is raised if:
*The task is assigned to a user name that is non-existent.
*The task is already assigned (unless it is being assigned to the same user).
Note that you cannot assign a task to a queue or group, only to a user.