Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Workflow started using Powershell : stuck on "Starting" state

$
0
0

Hi,

I am starting a workflow using Powershell script, but this workflow is stuck on "Starting" state.
I also start this workflow programmatically on my C# code and it's working well like that.

- The required fields are filled for the items
- There is no approval or versionning on this list.

Here is the code i use :

$sourceWebURL = "myWebUrl"
$spSourceWeb = Get-SPWeb $sourceWebURL
$spList = $spSourceWeb.Lists["myList"]

$spSourceWeb.AllowUnsafeUpdates = $true;
$manager = $spSourceWeb.Site.WorkFlowManager
$association = $spList.WorkFlowAssociations | where {$_.Name -eq "myWFName"}

$data = $association.AssociationData
$wf = $manager.StartWorkFlow($myItem,$association,$data,$true)

$manager.Dispose()

I also tried :

$association.AllowAsyncManualStart = $false    /  and  $true
$association.AllowManual = $true

Do you have any suggestions ?

Thanks

Sylvain


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>