4

I am trying to figure out how I can access properties of a running workflow instance. I have created the following PowerShell:

Add-PSSnapin microsoft.sharepoint.powershell
$web = Get-SPWeb http://app-72b5c37f94da1d.apps.sharepoint2013.local/sites/appdev/SharePointWorkflowApp
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$list= ($web.lists|where Title -eq "List1")
$sub = $wfm.GetWorkflowSubscriptionService()
$subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
$inst = $wfm.GetWorkflowInstanceService()
$instances= $inst.Enumerate($subscriptions[0])
$instance= $instances[0]
$instance.Status
$instance.UserStatus
$instance.Properties

I am not able to retrieve the arguments or variables via this route. Only UserStatus is a valid working option at this point.

The variables and arguments of the sequence which I have configured via Visual Studio 2013's Workflow Designer, resulted in the following xaml:

<x:Members>
    <x:Property Name="EenArg" Type="InArgument(x:String)" />
    <x:Property Name="argument1" Type="x:String" />
    <x:Property Name="argument2" Type="InOutArgument(x:String)" />
    <x:Property Name="strArg" Type="InOutArgument(x:String)" />
    <x:Property Name="intArg" Type="InOutArgument(x:String)" />
    <x:Property Name="dateTimeArg" Type="InOutArgument(x:String)" />
  </x:Members>

None of which are propagated via de Properties collection.

What am I missing here?

(crossposted at MSDN Forums as well: http://social.msdn.microsoft.com/Forums/en-US/482412b9-86ca-435e-becb-bfbc6a33c378/how-to-access-properties-of-running-workflow-2013-instances?forum=sharepointdevelopment)

Carl in 't Veld
  • 1,363
  • 2
  • 14
  • 29

0 Answers0