0

我有一个商业案例,我必须签入,在工作流程中通过 PSI 签出项目,但是当我签出项目时,我无法继续工作流程阶段,PWA 写道,我在另一个会话中签出项目,我需要继续 PWA 的工作流程?任何帮助或建议

4

1 回答 1

1

你重置你的 sessionId 吗?您必须在整个过程中存储它。这是一个简短的例子:

//set guids for session and job
Guid sessionId = Guid.NewGuid();
Guid jobId = Guid.NewGuid();

//checkout in the current session
projectSvc.CheckOutProject(ProjectId, sessionId, "custom field update checkout");

//do something (for example, update a project) with the same sessionId!
bool validateOnly = false;
projectSvc.QueueUpdateProject(jobId, sessionId, project, validateOnly);

//simply wait, if you don't use queuing services
System.Threading.Thread.Sleep(4000);

//create a new job ID for the checkin, sessionId stays the same as before!
jobId = Guid.NewGuid();

//checkin the project
bool force = false;
string sessionDescription = "updated custom fields";
projectSvc.QueueCheckInProject(jobId, ProjectId, force, sessionId, sessionDescription);

//wait again (very ugly)
System.Threading.Thread.Sleep(4000);

在这里查看我的答案:使用 PSI 设置自定义字段 - Microsoft Project Server

于 2012-04-20T13:20:11.760 回答