CheckIn,CheckOut项目对于使用PSI的特定用户?

时间:2011-09-13 14:15:06

标签: workflow psi ms-project-server-2010

我有一个商业案例,我必须检查,PSI在工作流程中检查项目,但是当我 检查项目我不能继续工作流程阶段PWA写道,我在另一个会话中检查项目,我需要继续PWA的工作流程?任何帮助或建议

1 个答案:

答案 0 :(得分: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);

在此处查看我的答案:Setting custom fields using the PSI - Microsoft Project Server