Process Endpoint and Methods

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.

The process resource can be accessed via the api/process endpoint.

Using the POST method with the Process Endpoint

The POST method will start a new process instance with the specified parameters.

JSON Examples

JSON Request

{
    "DataFields": [
        {
            "Name": "DataField1Name",
            "Value": "DataField1Value"
        },
        {
            "Name": "DataField2Name",
            "Value": "DataField2Value"
        }
    ],
    "XmlFields": [
        {
            "Name": "XmlField1Name",
            "Value": "<xmlData1 />"
        },
        {
            "Name": "XmlField2Name",
            "Value": "<xmlData2 />"
        }
    ],
    "Name": "Process1",
    "FullName": "K2WorkflowProject\\Process1",
    "Description": "Some Workflow",
    "ExpectedDuration": "400.22:14:17.6040000",
    "Priority": 2
}

JSON Response

{
    "DataFields": [
        {
            "Name": "DataField1Name",
            "Value": "DataField1Value"
        },
        {
            "Name": "DataField2Name",
            "Value": "DataField2Value"
        }
    ],
    "XmlFields": [
        {
            "Name": "XmlField1Name",
            "Value": "<xmlData1 />"
        },
        {
            "Name": "XmlField2Name",
            "Value": "<xmlData2 />"
        }
    ],
    "Name": "Process1",
    "FullName": "K2WorkflowProject\\Process1",
    "Description": "Some Workflow",
    "ExpectedDuration": "400.22:14:17.6040000",
    "Guid": "5e6ee90e-27be-4f4f-888d-0a2a870318d5",
    "Id": 100,
    "Priority": 2,
    "StartDate": "2013-10-23T17:33:45.5763696+02:00",
    "Status": 2
}

XML Examples

XML Request

<WorkflowInstance
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://schemas.k2.com/2013/web/rest/process.xsd">
  <DataFields
        xmlns:d2p1="http://schemas.k2.com/2013/web/rest/worklistitem.xsd">
    <d2p1:DataField>
      <d2p1:Name>DataField1Name</d2p1:Name>
      <d2p1:Value>DataField1Value</d2p1:Value>
    </d2p1:DataField>
    <d2p1:DataField>
      <d2p1:Name>DataField2Name</d2p1:Name>
      <d2p1:Value>DataField2Value</d2p1:Value>
    </d2p1:DataField>
  </DataFields>
  <Description>Some Workflow</Description>
  <ExpectedDuration>P400DT22H14M17.604S</ExpectedDuration>
  <FullName>K2WorkflowProject\Process1</FullName>
  <Priority>2</Priority>
  <XmlFields
        xmlns:d2p1="http://schemas.k2.com/2013/web/rest/worklistitem.xsd">
    <d2p1:XmlField>
      <d2p1:Name>XmlField1Name</d2p1:Name>
      <d2p1:Value>&lt;xmlData1 /&gt;</d2p1:Value>
    </d2p1:XmlField>
    <d2p1:XmlField>
      <d2p1:Name>XmlField2Name</d2p1:Name>
      <d2p1:Value>&lt;xmlData2 /&gt;</d2p1:Value>
    </d2p1:XmlField>
  </XmlFields>
</WorkflowInstance>

XML Response

<WorkflowInstance
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://schemas.k2.com/2013/web/rest/process.xsd">
  <DataFields
        xmlns:d2p1="http://schemas.k2.com/2013/web/rest/worklistitem.xsd">
    <d2p1:DataField>
      <d2p1:Name>DataField1Name</d2p1:Name>
      <d2p1:Value>DataField1Value</d2p1:Value>
    </d2p1:DataField>
    <d2p1:DataField>
      <d2p1:Name>DataField2Name</d2p1:Name>
      <d2p1:Value>DataField2Value</d2p1:Value>
    </d2p1:DataField>
  </DataFields>
  <Description>Some Workflow</Description>
  <ExpectedDuration>P400DT22H14M17.604S</ExpectedDuration>
  <FullName>K2WorkflowProject\Process1</FullName>
  <Guid>03598c07-7a56-45e0-bc1a-b26317c8a10e</Guid>
  <Id>100</Id>
  <Name>Process1</Name>
  <Priority>2</Priority>
  <StartDate>2013-10-23T17:33:29.1048281+02:00</StartDate>
  <Status>Active</Status>
  <XmlFields
        xmlns:d2p1="http://schemas.k2.com/2013/web/rest/worklistitem.xsd">
    <d2p1:XmlField>
      <d2p1:Name>XmlField1Name</d2p1:Name>
      <d2p1:Value>&lt;xmlData1 /&gt;</d2p1:Value>
    </d2p1:XmlField>
    <d2p1:XmlField>
      <d2p1:Name>XmlField2Name</d2p1:Name>
      <d2p1:Value>&lt;xmlData2 /&gt;</d2p1:Value>
    </d2p1:XmlField>
  </XmlFields>
</WorkflowInstance>