Worklist/Items/ExecuteAction

This content applies to legacy components (such as K2 Studio and K2 for Visual Studio), legacy assemblies, legacy services or legacy functionality. If you have upgraded from K2 blackpearl 4.7 to K2 Five, these items may still be available in your environment. These legacy items may not be available in new installations of K2 Five. These legacy items may also not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component support policy for more information about support for these components.

Executes the action specified and updates the worklist item with the data posted.

  • Only actions which have been configured to support batch processing can be updated via this GET method.  Use the Worklist/Items/Execute service to action items that do not support batch processing.
  • The Worklist service can only execute process specific actions for a single item.  Use the Task service to action items with system actions (Delegate, Redirect or Sleep) and perform batch processing.

URI

{Service Root URI}/Worklist/Items/ExecuteAction?{Query Options}
https://api.denallix.com:443/K2Services/REST.svc/Worklist/Items/ExecuteAction

Method

POST

This method cannot be called via URI construction in the address bar of standard browsers.  Tooling such as Fiddler or .NET code may be required to execute the POST.

Query Options

Required

  • action (String) – the process-specific configurable action to perform for the worklist item

Optional

  • Custom Query Options – by default processing will not be done synchronously.  Changing either the service configuration (web.config) or providing these query options can force synchronous processing.
    • synchronous (Boolean) – determines if the server performs this action synchronously

Request Headers

Ensure that the request has at least these headers set.

  • Authorization – Basic or NTLM (Windows)
  • Content-type – application/xml
Authorization: Basic {encrypted token goes here}
Content-type: application/xml

Request Body

The request body contains the WorklistItem represented as XML.  The Worklist Item XML returned from Worklist GET methods can be used as a starting point for the XML input of this POST method.  Any invalid elements or attributes will be ignored.

The WorklistItem XML consists of the following.

Namespaces

The WorklistItem XML requires namespaces to be defined.

  • xmlns:w="http://schemas.k2.com/worklist/d1" (required) – contains the worklist item attributes and nodes
  • xmlns:p="http://schemas.k2.com/process/d1" (optional) – contains the nodes for process data and XML fields when provided

Elements and Attributes

  • <WorklistItem>
    • @SerialNumber (Integer, required) – the serial number of the worklist item to update
  • <ProcessInstance>
  • @ExpectedDuration (Integer) – a expected duration in minutes to assign to the process instance
  • @Priority (Integer) – the priority to assign to the process instance
  • @Folio (String) – the folio value to assign to the process instance
  • <DataField> (XML) – the process data fields to update in XML format.  In .Net use XmlConvert.ToString to get the string value otherwise use XmlConvert.To[Type] to get the actual value.
  • <XmlField> (XML) – the process XML fields as escaped XML.  In .Net use XML objects to get the value: XmlDocument.InnerText, XmlReader.InnerText, XmlWriter.InnerText, or XDocument.Value.

Return Type

Success/Failure

Due to the asynchronous nature of the POST, a successful call may not return anything depending on the tooling used to execute the POST.