Process/Instances/UpdateProcessInstance

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.

Updates an existing process instance with the data posted.

  Value Notes
URI {Service Root URI}/Process/Instances/UpdateProcessInstance?{Query Options}
e.g.
https://api.denallix.com:443/K2Services/REST.svc/Process/Instances/UpdateProcessInstance?synchronous=true
  • Custom Query Options – by default worklist item detail data will not be returned and processing will not be done synchronously.  Changing either the service configuration (web.config) or providing these query options can override whether detail data is returned and force synchronous processing.
    • piDataField (Boolean) – determines if process level data fields should be returned
    • piXmlField (Boolean) – determines if process level XML fields should be returned
    • synchronous (Boolean) – determines if the server executes this process synchronously
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
Request Headers Authorization: Basic or NTLM (Windows) {encrypted token goes here}
Content-type: application/xml

Ensure that the request has at least these headers set.

  • Authorization – Basic or NTLM (Windows)
  • Content-type – application/xml
Request Body   The request body contains the ProcessInstance item represented as XML.  The ProcessInstance item XML returned from Process 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
Request Body Example <w:ProcessInstance
    xmlns:w="http://schemas.k2.com/worklist/d1"
    xmlns:p="http://schemas.k2.com/process/d1" ID="8" Priority="1" Folio="Order-ACME-Updated" ExpectedDuration="60">
    <p:DataField Name="MyProcessDataField">Some process data value</p:DataField>
    <p:XmlField Name="MyProcessXMLField">
        <XmlDocument>Some Process XML document</XmlDocument>
    </p:XmlField>
</w:ProcessInstance>

 
Namespaces The ProcessInstance XML requires namespaces to be defined.
• xmlns:w="http://schemas.k2.com/worklist/d1" (required) – contains the process instance and nodes
• xmlns:p="http://schemas.k2.com/process/d1" (optional) – contains the nodes for process and activity data fields when provided
 
Elements and Attributes
  • <ProcessInstance>
    • @ID (Integer, required) – the identifier of the process instance
    • @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) – data field values are XML formatted.  In .Net use XmlConvert.ToString to get the string value otherwise use XmlConvert.To[Type] to get the actual value.
    • <XmlField> (XML) – XML field values are XML escaped.  In .Net use XML objects to get the value: XmlDocument.InnerText, XmlReader.InnerText, XmlWriter.InnerText, or XDocument.Value.
 
Return Type

ProcessInstance or 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
Return Example <DataFieldCollection
    xmlns="http://schemas.k2.com/process/d1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <DataField Name="MyProcessDataField1">Some data value</DataField>
    <DataField Name="MyProcessDataField2">Some other data value</DataField>
</DataFieldCollection>