HowTo: Delegate a Workitem using the Workflow API

Official Content
This documentation is valid for:

This article describes how to delegate a workitem using the Workflow API. Take into account that when you delegate a task using the API, constraints are not checked. Therefore, it doesn't matter whether you set the task's properties to Allow delegation, Delegation mode, or Maximum length of delegation.

To do this, execute the following code:

&WorkflowUser = &WorkflowOrganizationalModel.GetUserByName(&userName)

Where the data types variables are as follows:

&WorkflowServer – WorkflowServer
&WorkflowOrganizationalModel – WorkflowOrganizationalModel
&WorkflowUser – WorkflowUser
&userName – WorkflowName
&WorkflowWorkitem – WorkflowWorkitem