GetWorkflowHistory

Get a collection of workflow log entries, optionally filtered by workflow state or workflow name, either for the current site or for a file in a SharePoint document library.

Syntax

public WorkflowLogCollection GetWorkflowHistory(
	string fileUrl,
	SPWorkflowState stateFilter,
	string workflowNameFilter
)

Parameters

fileUrl
Type: System.String

Optional. The absolute or relative URL of the file on which to get the workflow history for reusable or list workflows. If a relative URL is specified, the URL must be relative to the current SharePoint website.

To get the workflow history for site workflows, do not specify a value for this parameter.

stateFilter
Type: SPWorkflowState

Required. The workflow state on which to filter workflow history.

workflowNameFilter
Type: System.String

Optional. The workflow on which to filter workflow history. If a value is not specified, workflow history is returned for all workflows.

Returns

Type: WorkflowLogCollection

A collection of WorkflowLog objects, each of which represents a workflow log entry for a workflow.

Remarks

If a URL is specified in fileUrl, and the file cannot be found, an error occurs.

Example

The following example demonstrates how to use this operation to get a collection of workflow log entries for a file in a SharePoint document library, filtered for a specific list workflow.

Request

The following SOAP request attempts to get a collection of workflow log entries for a text file named TextDocument.txt, filtered to return all workflow log entries for the list workflow named TestDocFlexiTaskWorkflow.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:GetWorkflowHistory>
         <nin:fileUrl>/Shared%20Documents/TestDocument.txt</nin:fileUrl>
         <nin:stateFilter>All</nin:stateFilter>
         <nin:workflowNameFilter>TestDocFlexiTaskWorkflow</nin:workflowNameFilter>
      </nin:GetWorkflowHistory>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response returns a collection of workflow log entries.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <GetWorkflowHistoryResponse xmlns="http://nintex.com">
         <GetWorkflowHistoryResult>
            <WorkflowLog>
               <WorkflowName>TestDocFlexiTaskWorkflow</WorkflowName>
               <InternalState>Running</InternalState>
               <StartDate>2015-01-27T22:38:20.633</StartDate>
               <StartTimeShort>9:38 AM</StartTimeShort>
               <StartTimeLong>9:38:20 AM</StartTimeLong>
               <StartDateShort>1/28/2015</StartDateShort>
               <StartDateLong>Wednesday, January 28, 2015</StartDateLong>
               <LastModifiedDate>2015-01-27T22:38:20.637</LastModifiedDate>
               <LastModifiedTimeShort>9:38 AM</LastModifiedTimeShort>
               <LastModifiedTimeLong>9:38:20 AM</LastModifiedTimeLong>
               <LastModifiedDateShort>1/28/2015</LastModifiedDateShort>
               <LastModifiedDateLong>Wednesday, January 28, 2015</LastModifiedDateLong>
               <WorkflowInstanceId>e60bae97-46cd-44b0-87cb-371974f08fc3</WorkflowInstanceId>
               <Activities>
                  <ActivityLogInfo>
                     <StartTime>2015-01-27T22:38:20.637</StartTime>
                     <StartTimeShort>9:38 AM</StartTimeShort>
                     <StartTimeLong>9:38:20 AM</StartTimeLong>
                     <StartDateShort>1/28/2015</StartDateShort>
                     <StartDateLong>Wednesday, January 28, 2015</StartDateLong>
                     <EndTime>0001-01-01T00:00:00</EndTime>
                     <EndTimeShort/>
                     <EndTimeLong/>
                     <EndDateLong/>
                     <ActivityTitle>Assign Flexi task</ActivityTitle>
                     <SequenceId>0</SequenceId>
                     <ProgressId>183</ProgressId>
                  </ActivityLogInfo>
               </Activities>
               <HumanTasks>
                  <HumanTaskLogInfo>
                     <EntryTime>2015-01-27T22:38:20.72</EntryTime>
                     <EntryTimeShort>9:38 AM</EntryTimeShort>
                     <EntryTimeLong>9:38:20 AM</EntryTimeLong>
                     <EntryDateShort>1/28/2015</EntryDateShort>
                     <EntryDateLong>Wednesday, January 28, 2015</EntryDateLong>
                     <EndTime>0001-01-01T00:00:00</EndTime>
                     <EndTimeShort/>
                     <EndTimeLong/>
                     <EndDateShort/>
                     <EndDateLong/>
                     <DisplayName>PM13-Administrator</DisplayName>
                     <ActivityTitle>Assign Flexi task</ActivityTitle>
                     <SequenceId>0</SequenceId>
                     <Username>i:0#.w|testdomain\testuser</Username>
                     <Email/>
                     <UserStart>2015-01-27T22:38:21.02</UserStart>
                     <UserStartTimeShort>9:38 AM</UserStartTimeShort>
                     <UserStartTimeLong>9:38:21 AM</UserStartTimeLong>
                     <UserStartDateShort>1/28/2015</UserStartDateShort>
                     <UserStartDateLong>Wednesday, January 28, 2015</UserStartDateLong>
                     <UserEnd>9999-12-31T23:59:59.997</UserEnd>
                     <UserEndTimeShort/>
                     <UserEndTimeLong/>
                     <UserEndDateShort/>
                     <UserEndDateLong/>
                     <UserComments/>
                     <Outcome>Pending</Outcome>
                     <CustomOutcome/>
                     <UserActionTime>9999-12-31T23:59:59.997</UserActionTime>
                     <UserActionTimeShort/>
                     <UserActionTimeLong/>
                     <UserActionDateShort/>
                     <UserActionDateLong/>
                  </HumanTaskLogInfo>
               </HumanTasks>
            </WorkflowLog>
         </GetWorkflowHistoryResult>
      </GetWorkflowHistoryResponse>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Workflows

Operations

Managing workflow history

Reference

GetWorkflowHistoryForListItem

Web Service Reference