Web Services API: Get Process Data and Form Data Values

Overview

The GetProcessInstanceContext and GetProcessInstanceFormData web methods allow you to retrieve process data and form data values of a specified request.

The web method parameters are:

  • processInstanceId: The request ID

  • workflowContext: The process data or form fields to retrieve

These web methods can only be called by allowed users as defined in the ProcessesRuntimeWebServiceAllowedUsers parameter in the \wfgen\web.config file.

GetProcessInstanceContext

GetProcessInstanceContext returns the request associated data values. If the workflowContext parameter is null or empty, all of the process data are returned.

For performance reasons, it is recommended to use the workflowContext parameter only to specify the process data needed.

Examples

This call returns an XML workflow context string with all of the associated data for request 12492:

GetProcessInstanceContext(12492)

This call returns the REQUEST_NUM and REQUEST_DATE associated data in an XML workflow context string for request 12492:

GetProcessInstanceContext(12492, myContext) 

Here, myContext contains the following XML code:

<NewDataSet>
    <parameter>
        <name>REQUEST_NUM</name>
        <dataType>NUMERIC</dataType>
        <direction>IN</direction>
    </parameter>
    <parameter>
        <name>REQUEST_DATE</name>
        <dataType>DATETIME</dataType>
        <direction>IN</direction>
    </parameter>
</NewDataSet>

GetProcessInstanceFormData

GetProcessInstanceFormData returns the form data field values. The workflowContext parameter must be defined with the field Id to retrieve. Note that the full form field Ids must be used (e.g. REQUEST_LASTNAME), and GridView form data are not supported.

Example

This call returns the REQUEST_AMOUNT and APPROVAL_DATE form field values in an XML workflow context string for request 12492:

GetProcessInstanceFormData(12492, myContext) 

Here, myContext contains the following XML code:

<NewDataSet>
    <parameter>
        <name>REQUEST_AMOUNT</name>
        <dataType>NUMERIC</dataType>
        <direction>IN</direction>
    </parameter>
    <parameter>
        <name>APPROVAL_DATE</name>
        <dataType>DATETIME</dataType>
        <direction>IN</direction>
    </parameter>
</NewDataSet>

GetProcessInstanceFormData supports the optional FormDataName SOAP header/querystring parameter. By default, the web method looks for the FORM_DATA process data name; the FormDataName parameter lets you specify a different process data name that contains the XML form data to query.