UpdateRunningWorkflowTaskDef API¶
Updates a task definition on a currently executing (running) workflow step. The entire updated task configuration — deadline, assignees, permissions, requirements, and instructions — is passed as a single XML string in the taskDefXML parameter, replacing the current values.
The workflow must be actively running on the document. Use UpdateWorkflowTaskDef to update task definitions on inactive workflow definitions.
Endpoint¶
Methods¶
- GET
/srv.asmx/UpdateRunningWorkflowTaskDef?authenticationTicket=...&documentPath=...&workflowId=...&stepNumber=...&taskDefId=...&taskDefXML=... - POST
/srv.asmx/UpdateRunningWorkflowTaskDef(form data) - SOAP Action:
http://tempuri.org/UpdateRunningWorkflowTaskDef
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
documentPath |
string | Yes | Full infoRouter path of the document whose running workflow contains the task definition to update. |
workflowId |
integer | Yes | Numeric ID of the running workflow instance on the document. |
stepNumber |
integer | Yes | The step number within the running workflow that contains the target task definition. |
taskDefId |
integer | Yes | The ID of the task definition to update within the specified step. |
taskDefXML |
string (XML) | Yes | URL-encoded XML document describing the updated task definition fields. Uses the same structure as AddFlowTaskDef. The DeadLine field is required and must be greater than zero. |
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. |
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 granted to the assignee for the duration of the task. Valid values: 0 = No access, 1 = List, 2 = Read, 3 = Add, 4 = Add + Read, 5 = Change, 6 = Full control. |
OnCompleteNotice |
string | No | Whether to send a notification to the document owner and supervisor when the task is completed. Valid values: "True" or "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.
<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>
<role RoleId="1" />
</SpecialUserRoles>
</AssigneeList>
<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 one of:
- the supervisor of the task definition being edited (its
SuperVisorId); - a library manager of the document's library;
- an assignee with an open task in this workflow that carries
EditNextStep(for the step right after that task's step) orEditAllSteps(for any later step).
Anyone else is refused with 4030. Being the workflow's supervisor, its submitter, or the system administrator does not by itself allow the edit; the system administrator can make it where they manage the library.
Example¶
POST Request¶
POST /srv.asmx/UpdateRunningWorkflowTaskDef HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&documentPath=%2FCorporate%2FContracts%2Fagreement.pdf
&workflowId=42
&stepNumber=1
&taskDefId=305
&taskDefXML=%3Ctaskdef+TaskName%3D%22LegalReview%22+DeadLine%3D%2272%22+...%2F%3E
GET Request¶
GET /srv.asmx/UpdateRunningWorkflowTaskDef
?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&documentPath=%2FCorporate%2FContracts%2Fagreement.pdf
&workflowId=42
&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;
}
Rewrites a task definition of a workflow that is already running. The caller needs a task in an
earlier step carrying EditNextStep or EditAllSteps - without one even the system administrator
who submitted the document is refused with 4030.
await call('UpdateRunningWorkflowTaskDef', {
authenticationTicket: ticket,
documentPath: '/Public/Invoices/inv-1001.pdf',
workflowId: 7332,
stepNumber: 2,
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 document must have an actively running workflow. Use UpdateWorkflowTaskDef to modify task definitions on inactive workflow definitions.
- The
DeadLinefield intaskDefXMLis required and must be greater than0. taskDefIdmust refer to a task definition in the specifiedstepNumberof the running workflow. Use the running workflow data to identify valid IDs.- The entire task definition is replaced by the supplied
taskDefXML. Any attributes or child elements omitted from the XML will revert to their defaults. SupervisorNotificationOnDueis in days relative to the task due date (negative = before due,0= at the due date, positive = after); it is not limited byDeadLine.ReminderTimeSpanmust not exceed theDeadLinevalue.
Related APIs¶
- UpdateWorkflowTaskDef - Update a task definition on an inactive workflow definition.
- StopCurrentWorkflow - Gracefully stop a running workflow with notifications.
- SubmitDocumentToFlow - Submit a document to a workflow definition.
- AddFlowTaskDef - Add a new task definition to a workflow step.
- GetFlowDef - Retrieve the full workflow definition including task definition IDs.
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown |
4030 |
the caller holds no earlier task with EditNextStep or EditAllSteps |
4041 |
no document at that path, stepNumber names no step, or taskDefId names no task definition |
4230 |
the document is marked offline |
4170 |
DeadLine is 0 - checked before anything else |
5000 |
<Permissions> is missing, or one of the six <Permission> rows has no Value |