Sharepoint 2013 如何获取SharePoint 2013工作流的SPWorkflowStatus

Sharepoint 2013 如何获取SharePoint 2013工作流的SPWorkflowStatus,sharepoint-2013,sharepoint-workflow,Sharepoint 2013,Sharepoint Workflow,我正在尝试获取SharePoint 2013工作流的SPWorkflowStatus。我只是尝试一些简单的事情,比如获取特定SPListItem的工作流,并尝试访问SPWorkflowStatus。在这个过程中,我还注意到,当SPWorkflowAssociation值是SharePoint 2010工作流时,我只看到列表中的SPWorkflowAssociation值。当列表是SharePoint 2013工作流时,我没有看到列表中的SPWorkflowAssociation条目。我只能认为我

我正在尝试获取SharePoint 2013工作流的SPWorkflowStatus。我只是尝试一些简单的事情,比如获取特定SPListItem的工作流,并尝试访问SPWorkflowStatus。在这个过程中,我还注意到,当SPWorkflowAssociation值是SharePoint 2010工作流时,我只看到列表中的SPWorkflowAssociation值。当列表是SharePoint 2013工作流时,我没有看到列表中的SPWorkflowAssociation条目。我只能认为我缺少了SP2013工作流的某些特定内容。非常感谢您的帮助。

您是否使用PowerShell获取列表关联工作流和项目工作流

我可以使用下面的代码获取列表的关联工作流

$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$sub = $wfm.GetWorkflowSubscriptionService()
$subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)

$siteURL = "URL"
$web = Get-SPWeb $siteURL
$list = $web.lists[$listname]
$items = $list.GetItems()
$items[0][$workflowname]