Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Project Server 2013 - Change Workflow Stage using PSI

$
0
0

Hi!

I'm have Project Server 2013 on SharePoint 2013 and I'm trying to restart workflow with skip to stage using PSI. My problem is that workflow does restart, but it doesn't skip to stage that I specify.

using (OperationContextScope scope = new OperationContextScope(workflowClient.InnerChannel))
{
  // Disable Forms authentication, to enable Windows authentication.
  WebOperationContext.Current.OutgoingRequest.Headers.Remove("X-FORMS_BASED_AUTH_ACCEPTED");
  WebOperationContext.Current.OutgoingRequest.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");

  Guid projectGuid = Guid.Parse(this.Page.Request.Params["ProjUid"]);
  Guid jobGuid = Guid.NewGuid();
  projectClient = new ProjectClient(httpBinding, new System.ServiceModel.EndpointAddress(String.Format(CultureInfo.InvariantCulture, "{0}/_vti_bin/PSI/ProjectServer.svc", serverUrl.TrimEnd('/'))));
  ProjectDataSet projectDataSet = projectClient.ReadProject(projectGuid, SvcProject.DataStoreEnum.WorkingStore);
  Guid eptGuid = projectDataSet.Project[0].ENTERPRISE_PROJECT_TYPE_UID;

  WfDS = new WorkflowDataSet();
  //  WfDS = WrkflowClient.ReadWorkflowStatus(PrjUID,true);
  WfDS.UpdateProjectWorkflows.AddUpdateProjectWorkflowsRow(jobGuid, projectGuid, eptGuid, false, stageGuid);
  workflowClient.QueueUpdateProjectWorkflows(WfDS);
}

 

If I go to PWA settings, manually restart workflow and select one stage to skip to, it works fine.

I would appreciate any help.

Regards, Parkelj

 


Viewing all articles
Browse latest Browse all 5347

Trending Articles



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