GetWorkflowHistoryForListItem

Get a collection of workflow log entries, optionally filtered by workflow state or workflow name, for a list item in a SharePoint list.

Syntax

public WorkflowLogCollection GetWorkflowHistoryForListItem(
	int itemId,
	string listName,
	SPWorkflowState stateFilter,
	string workflowNameFilter
)

Parameters

itemId
Type: System.Int32

Required. The identifier of the SharePoint list item.

listName
Type: System.String

Optional. The name of the SharePoint list.

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 the list specified in listName or the list item specified in itemId is not found, an error occurs.

Example

The following example demonstrates how to use this operation to get a collection of workflow log entries for a list item.

Request

The following SOAP request attempts to get a collection of workflow log entries, filtered for canceled workflows, for the list item with an identifier of 3 in the list named TestContacts1.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:GetWorkflowHistoryForListItem>
         <nin:itemId>3</nin:itemId>
         <nin:listName>TestContacts1</nin:listName>
         <nin:stateFilter>Cancelled</nin:stateFilter>
         <nin:workflowNameFilter></nin:workflowNameFilter>
      </nin:GetWorkflowHistoryForListItem>
   </soap:Body>
</soap:Envelope>

Response

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

<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>
      <GetWorkflowHistoryForListItemResponse xmlns="http://nintex.com">
         <GetWorkflowHistoryForListItemResult>
            <WorkflowLog>
               <WorkflowName>TestFlexiTaskWorkflow</WorkflowName>
               <InternalState>Cancelled</InternalState>
               <StartDate>2015-01-26T23:49:50.887</StartDate>
               <StartTimeShort>10:49 AM</StartTimeShort>
               <StartTimeLong>10:49:50 AM</StartTimeLong>
               <StartDateShort>1/27/2015</StartDateShort>
               <StartDateLong>Tuesday, January 27, 2015</StartDateLong>
               <LastModifiedDate>2015-01-26T23:49:50.923</LastModifiedDate>
               <LastModifiedTimeShort>10:49 AM</LastModifiedTimeShort>
               <LastModifiedTimeLong>10:49:50 AM</LastModifiedTimeLong>
               <LastModifiedDateShort>1/27/2015</LastModifiedDateShort>
               <LastModifiedDateLong>Tuesday, January 27, 2015</LastModifiedDateLong>
               <WorkflowInstanceId>827a236d-593c-4b69-8e2b-709f6c65a0c8</WorkflowInstanceId>
               <Activities>
                  <ActivityLogInfo>
                     <StartTime>2015-01-26T23:49:50.923</StartTime>
                     <StartTimeShort>10:49 AM</StartTimeShort>
                     <StartTimeLong>10:49:50 AM</StartTimeLong>
                     <StartDateShort>1/27/2015</StartDateShort>
                     <StartDateLong>Tuesday, January 27, 2015</StartDateLong>
                     <EndTime>0001-01-01T00:00:00</EndTime>
                     <EndTimeShort/>
                     <EndTimeLong/>
                     <EndDateLong/>
                     <ActivityTitle>Assign Flexi task</ActivityTitle>
                     <SequenceId>0</SequenceId>
                     <ProgressId>179</ProgressId>
                  </ActivityLogInfo>
               </Activities>
               <HumanTasks>
                  <HumanTaskLogInfo>
                     <EntryTime>2015-01-26T23:49:51.763</EntryTime>
                     <EntryTimeShort>10:49 AM</EntryTimeShort>
                     <EntryTimeLong>10:49:51 AM</EntryTimeLong>
                     <EntryDateShort>1/27/2015</EntryDateShort>
                     <EntryDateLong>Tuesday, January 27, 2015</EntryDateLong>
                     <EndTime>2015-01-27T18:25:08.61</EndTime>
                     <EndTimeShort>5:25 AM</EndTimeShort>
                     <EndTimeLong>5:25:08 AM</EndTimeLong>
                     <EndDateShort>1/28/2015</EndDateShort>
                     <EndDateLong>Wednesday, January 28, 2015</EndDateLong>
                     <DisplayName>TestUser</DisplayName>
                     <ActivityTitle>Assign Flexi task</ActivityTitle>
                     <SequenceId>0</SequenceId>
                     <Username>i:0#.w|testdomain\testuser</Username>
                     <Email/>
                     <UserStart>2015-01-26T23:49:53.06</UserStart>
                     <UserStartTimeShort>10:49 AM</UserStartTimeShort>
                     <UserStartTimeLong>10:49:53 AM</UserStartTimeLong>
                     <UserStartDateShort>1/27/2015</UserStartDateShort>
                     <UserStartDateLong>Tuesday, January 27, 2015</UserStartDateLong>
                     <UserEnd>9999-12-31T23:59:59.997</UserEnd>
                     <UserEndTimeShort/>
                     <UserEndTimeLong/>
                     <UserEndDateShort/>
                     <UserEndDateLong/>
                     <UserComments/>
                     <Outcome>Cancelled</Outcome>
                     <CustomOutcome/>
                     <UserActionTime>9999-12-31T23:59:59.997</UserActionTime>
                     <UserActionTimeShort/>
                     <UserActionTimeLong/>
                     <UserActionDateShort/>
                     <UserActionDateLong/>
                  </HumanTaskLogInfo>
               </HumanTasks>
               <WorkflowHistory>
                  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                     <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="NintexWorkflowHistory" msdata:Locale="en-US">
                        <xs:complexType>
                           <xs:choice minOccurs="0" maxOccurs="unbounded">
                              <xs:element name="NintexWorkflowHistory" msdata:Locale="en-US">
                                 <xs:complexType>
                                    <xs:sequence>
                                       <xs:element name="ID" type="xs:int" minOccurs="0"/>
                                       <xs:element name="ContentType" msdata:Caption="Content Type" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Modified" type="xs:dateTime" minOccurs="0"/>
                                       <xs:element name="Created" type="xs:dateTime" minOccurs="0"/>
                                       <xs:element name="Author" msdata:Caption="Created By" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Editor" msdata:Caption="Modified By" type="xs:string" minOccurs="0"/>
                                       <xs:element name="_UIVersionString" msdata:Caption="Version" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Attachments" type="xs:string" minOccurs="0"/>
                                       <xs:element name="LinkTitleNoMenu" msdata:Caption="Title" type="xs:string" minOccurs="0"/>
                                       <xs:element name="DocIcon" msdata:Caption="Type" type="xs:string" minOccurs="0"/>
                                       <xs:element name="ItemChildCount" msdata:Caption="Item Child Count" type="xs:string" minOccurs="0"/>
                                       <xs:element name="FolderChildCount" msdata:Caption="Folder Child Count" type="xs:string" minOccurs="0"/>
                                       <xs:element name="AppAuthor" msdata:Caption="App Created By" type="xs:string" minOccurs="0"/>
                                       <xs:element name="AppEditor" msdata:Caption="App Modified By" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Event" msdata:Caption="Event Type" type="xs:string" minOccurs="0"/>
                                       <xs:element name="WorkflowInstance" msdata:Caption="Workflow History Parent Instance" type="xs:string" minOccurs="0"/>
                                       <xs:element name="WorkflowAssociation" msdata:Caption="Workflow Association ID" type="xs:string" minOccurs="0"/>
                                       <xs:element name="WorkflowTemplate" msdata:Caption="Workflow Template ID" type="xs:string" minOccurs="0"/>
                                       <xs:element name="List" msdata:Caption="List ID" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Item" msdata:Caption="Primary Item ID" type="xs:int" minOccurs="0"/>
                                       <xs:element name="User" msdata:Caption="User ID" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Occurred" msdata:Caption="Date Occurred" type="xs:dateTime" minOccurs="0"/>
                                       <xs:element name="Group" msdata:Caption="Group Type" type="xs:int" minOccurs="0"/>
                                       <xs:element name="Outcome" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Duration" type="xs:double" minOccurs="0"/>
                                       <xs:element name="Description" type="xs:string" minOccurs="0"/>
                                       <xs:element name="Data" type="xs:string" minOccurs="0"/>
                                    </xs:sequence>
                                 </xs:complexType>
                              </xs:element>
                           </xs:choice>
                        </xs:complexType>
                     </xs:element>
                  </xs:schema>
                  <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
                     <DocumentElement xmlns="">
                        <NintexWorkflowHistory diffgr:id="NintexWorkflowHistory1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
                           <ID>26</ID>
                           <ContentType>Workflow History</ContentType>
                           <Modified>2015-01-28T05:25:05+11:00</Modified>
                           <Created>2015-01-28T05:25:05+11:00</Created>
                           <Author>TestUser</Author>
                           <Editor>TestUser</Editor>
                           <_UIVersionString>1.0</_UIVersionString>
                           <Attachments>0</Attachments>
                           <ItemChildCount>0</ItemChildCount>
                           <FolderChildCount>0</FolderChildCount>
                           <AppAuthor/>
                           <AppEditor/>
                           <Event>3</Event>
                           <WorkflowInstance>{827a236d-593c-4b69-8e2b-709f6c65a0c8}</WorkflowInstance>
                           <WorkflowAssociation>{e5d79bbd-a63b-467c-b65d-9536f6d0aa0f}</WorkflowAssociation>
                           <WorkflowTemplate>{4e883f23-7ccb-4c4d-8da2-ad6556eaab93}</WorkflowTemplate>
                           <List>{48d1e62d-8d86-42ec-9c57-8315bc55a686}</List>
                           <Item>3</Item>
                           <User>TestUser</User>
                           <Occurred>2015-01-28T05:25:05+11:00</Occurred>
                           <Group>0</Group>
                           <Duration>669327957497</Duration>
                           <Description>Workflow TestFlexiTaskWorkflow (Previous Version:1/27/2015 10:49:05 AM) was canceled by TestUser.</Description>
                        </NintexWorkflowHistory>
                     </DocumentElement>
                  </diffgr:diffgram>
               </WorkflowHistory>
            </WorkflowLog>
         </GetWorkflowHistoryForListItemResult>
      </GetWorkflowHistoryForListItemResponse>
   </soap:Body>
</soap:Envelope>

See Also

Web Service Reference