UpdateWorkflowTaskDef API¶
Updates an existing task definition within a step of an inactive workflow definition. The entire updated task configuration — name, deadline, assignees, permissions, requirements, and instructions — is passed as a single XML string in the TaskDefXML parameter, replacing the current values.
The workflow definition must be in inactive (deactivated) state. Use DeactivateFlowDef first if the workflow is currently active.
Endpoint¶
Methods¶
- GET
/srv.asmx/UpdateWorkflowTaskDef?authenticationTicket=...&domainName=...&flowName=...&stepNumber=...&taskDefId=...&taskDefXML=... - POST
/srv.asmx/UpdateWorkflowTaskDef(form data) - SOAP Action:
http://tempuri.org/UpdateWorkflowTaskDef
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
domainName |
string | Yes | Name of the domain/library that owns the workflow definition. |
flowName |
string | Yes | Name of the workflow definition containing the target step. |
stepNumber |
integer | Yes | The step number that contains the task definition to update. |
taskDefId |
integer | Yes | The ID of the task definition to update. Task definition IDs are returned by GetFlowDef. |
taskDefXML |
string (XML) | Yes | URL-encoded XML document describing the updated task definition. Uses the same structure as AddFlowTaskDef. |
TaskDefXML Structure¶
The taskDefXML parameter uses the same XML format as AddFlowTaskDef. The root element carries the task attributes and may contain child elements for permissions, requirements, the instruction text, and the assignee list.
Root element attributes¶
| Attribute | Type | Required | Description |
|---|---|---|---|
TaskName |
string | Yes | Display name of the task. Maximum 32 alphanumeric characters. |
DeadLine |
integer | Yes | Task deadline in hours from the time the task is assigned. Must be greater than 0. |
RequiredAssigneeCount |
integer | No | Controls how the system selects and completes tasks among multiple assignees. Valid values: 0 = All assignees must complete (default), 1 = System picks one assignee automatically, 2 = All are assigned but only one needs to complete. This is a mode, not a count. Any other value (including values above 2) is accepted without error and behaves as 0. 1 picks the assignee with the fewest open tasks when the step starts; 2 drops the other assignees' unfinished tasks for this task definition as soon as one completes. |
SuperVisorId |
integer | No | User ID of the task supervisor. 0 = no supervisor. |
SupervisorNotificationOnDue |
integer | No | Days relative to the task due date when the task supervisor (SuperVisorId) is notified: negative = before due (-1 = one day before), 0 = at the due date, positive = after. Only sent if SuperVisorId > 0. The same notice also goes to the workflow's supervisors (users and group members). A task without its own supervisor sends none. |
Priority |
integer | No | Task priority. Valid values: 0 = No priority (default), 1 = Low, 5 = Normal, 10 = High, 11 = Urgent. |
AllowedStartTimeSpan |
integer | No | Number of hours after assignment in which the assignee must start the task. 0 = no restriction. |
ReminderTimeSpan |
integer | No | Number of hours before the deadline when a reminder is sent to the assignee. 0 = no reminder. Must not exceed DeadLine. |
righttype |
integer | No | Document access right level for the assignee. Evaluated at access time and never written to the document's permissions: it raises the assignee's right on the document (not the folder) while their task is started and open, and ends when the task is completed, dropped or reassigned. It does not override an explicit No Access, and Read-only users stay at Read. Valid values: 0 = No access, 1 = List, 2 = Read, 3 = Add, 4 = Add + Read, 5 = Change, 6 = Full control. |
OnCompleteNotice |
string | No | When true, sends ON_TASKCOMPLETED to the task's assigner (for workflow tasks, the user who submitted the document) and the workflow submitter, and adds the assigner to the workflow's approved/rejected/finished notices. Case-insensitive true/false (default false). |
Child elements¶
<instruction> (required)
Contains the plain-text instructions shown to the assignee.
<Permissions> (optional)
Grants the assignee additional task-level permissions beyond simple completion. Rows that are omitted, or have an unreadable Value, are treated as not granted.
<Permissions>
<Permission Name="EditDocument" Value="True" />
<Permission Name="Postpone" Value="True" />
<Permission Name="ChangeFinishdate" Value="False" />
<Permission Name="ChangePriority" Value="False" />
<Permission Name="EditNextStep" Value="False" />
<Permission Name="EditAllSteps" Value="False" />
</Permissions>
| Permission Name | Description |
|---|---|
EditDocument |
Assignee can edit the document content. |
Postpone |
Assignee can change the task due date. |
ChangeFinishdate |
Assignee can change the task finish date. |
ChangePriority |
Assignee can change the task priority. |
EditNextStep |
Assignee can modify the next workflow step. |
EditAllSteps |
Assignee can modify all remaining workflow steps. |
<AssigneeList> (optional)
Specifies users, user groups, and/or special roles assigned to the task.
<AssigneeList>
<Users>
<user UserID="101" />
<user UserID="102" />
</Users>
<UserGroups>
<group GroupID="55" />
</UserGroups>
<SpecialUserRoles>
<SpecialUserRole RoleId="-5" />
</SpecialUserRoles>
</AssigneeList>
Only -5 (document owner at submit time) and -8 (submitter) are accepted; other ids are silently ignored. Only children of <SpecialUserRoles> are read; the element name does not matter.
<Requirements> (optional)
Specifies additional actions the assignee must complete before the task can be marked as done.
<Requirements>
<Requirement Name="Approval" RefObjectId="0" Definition="" />
<Requirement Name="LastestVersionRead" RefObjectId="0" Definition="" />
</Requirements>
Valid Name values for requirements:
| Name | Description |
|---|---|
NoRequirement |
No additional requirements. |
Sign |
Assignee must electronically sign. |
Edit |
Assignee must edit the document. |
LastestVersionRead |
Assignee must read the latest version. |
Comments |
Assignee must add a comment. |
Approval |
Assignee must set an approval status. |
Archive |
Assignee must archive the document. |
SOXReview |
Assignee must complete a SOX review. |
ISOReview |
Assignee must complete an ISO review. |
Dispose |
Assignee must dispose of the document. |
Downgrade |
Assignee must downgrade the classification. |
Declassify |
Assignee must declassify the document. |
PublishedVersionRead |
Assignee must read the published version. |
Transfer |
Assignee must transfer the document. |
Attachment |
Assignee must add an attachment. |
FormTemplate |
Assignee must complete a form template. |
MetaData |
Assignee must update metadata/property sets. |
ReproptPassword |
Assignee must re-enter password for reprompt. |
Complete TaskDefXML example¶
<taskdef
TaskName="LegalReview"
DeadLine="72"
RequiredAssigneeCount="0"
SuperVisorId="0"
SupervisorNotificationOnDue="0"
Priority="5"
AllowedStartTimeSpan="0"
ReminderTimeSpan="24"
righttype="2"
OnCompleteNotice="False">
<instruction>Please review the document for legal compliance and approve or reject it before the deadline.</instruction>
<Permissions>
<Permission Name="EditDocument" Value="False" />
<Permission Name="Postpone" Value="True" />
<Permission Name="ChangeFinishdate" Value="False" />
<Permission Name="ChangePriority" Value="False" />
<Permission Name="EditNextStep" Value="False" />
<Permission Name="EditAllSteps" Value="False" />
</Permissions>
<AssigneeList>
<Users>
<user UserID="101" />
</Users>
</AssigneeList>
<Requirements>
<Requirement Name="Approval" RefObjectId="0" Definition="" />
</Requirements>
</taskdef>
Response¶
Success Response¶
Error Response¶
Required Permissions¶
The calling user must be a workflow supervisor, a domain/library manager, or a system administrator.
Example¶
POST Request¶
POST /srv.asmx/UpdateWorkflowTaskDef HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&domainName=Corporate
&flowName=Document+Approval
&stepNumber=1
&taskDefId=305
&taskDefXML=%3Ctaskdef+TaskName%3D%22LegalReview%22+DeadLine%3D%2272%22+...%2F%3E
GET Request¶
GET /srv.asmx/UpdateWorkflowTaskDef
?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&domainName=Corporate
&flowName=Document+Approval
&stepNumber=1
&taskDefId=305
&taskDefXML=%3Ctaskdef+TaskName%3D%22LegalReview%22+DeadLine%3D%2272%22+...%2F%3E
HTTP/1.1
Host: yourserver
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Replaces a task definition in place, keeping its TaskDefId. taskDefXML takes exactly the shape
AddFlowTaskDef documents, six <Permission> rows included.
await call('UpdateWorkflowTaskDef', {
authenticationTicket: ticket,
domainName: 'Public',
flowName: 'Invoice approval',
stepNumber: 1,
taskDefId: 7331,
taskDefXML: taskDef // the document AddFlowTaskDef shows
});
Notes¶
- Length limits in the task definition xml:
TaskName32 characters, and theDefinitionof eachRequirement255. A longer value is refused with4000. - The workflow definition must be inactive before task definitions can be updated. Use DeactivateFlowDef if the workflow is currently active.
- Use GetFlowDef to retrieve existing
taskDefIdvalues and current task configuration before calling this API. - The
taskDefXMLvalue must be URL-encoded when sent via GET or form-encoded POST. - The entire task definition is replaced by the supplied
taskDefXML. Any attributes or child elements omitted from the XML will revert to their defaults. In particularOnCompleteNoticeresets to false andrighttypeto 0 (No access) when omitted. GetFlowDef does not returnOnCompleteNotice, and returns the right as a<RightType RightTypeId>element rather than arighttypeattribute. DeadLineis required and must be greater than0.instructionis required and must not be empty.SupervisorNotificationOnDueis in days relative to the task due date when the task supervisor (SuperVisorId) is notified: negative = before due (-1= one day before),0= at the due date, positive = after. Only sent ifSuperVisorId> 0. The same notice also goes to the workflow's supervisors (users and group members). A task without its own supervisor sends none.
Related APIs¶
- AddFlowTaskDef - Add a new task definition to a workflow step.
- DeleteFlowTaskDef - Delete a task definition from a workflow step.
- GetFlowDef - Retrieve the full workflow definition including task definition IDs.
- DeactivateFlowDef - Deactivate an active workflow before modifying it.
- ActivateFlowDef - Activate the workflow after modifications are complete.
- UpdateWorkflowStepDef - Update the name and on-start folder of a workflow step.
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown |
4000 |
no definition by that name, no task definition by that id, DeadLine is 0, or taskDefXML is not well formed |
4030 |
the caller may not manage workflows in that library |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |