以下の作成者コードに戻ると、コアサービスベースのワークフローでは機能しません。
エラーは発生しません。助言がありますか?
public void BackToAuthor(string workitemid)
{
var client = new CoreServiceSession();
var csClient = client.GetClient();
var readoption = new ReadOptions();
var workitem = (WorkItemData)csClient.Read(workitemid, readoption);
var processInstance = (ProcessInstanceData)csClient.Read(
workitem.Process.IdRef, readoption);
var ieActivities = processInstance.Activities;
if (ieActivities != null)
{
var targetactivity = (ActivityInstanceData)csClient.Read(
processInstance.Activities[0].Id, readoption);
var finishData = new ActivityFinishData();
finishData.Message = "Finished automatically";
finishData.NextAssignee = new LinkToTrusteeData {
IdRef = processInstance.Activities[0].Performers[0].IdRef,
Title = processInstance.Activities[0].Performers[0].Title };
csClient.FinishActivity(targetactivity.Id, finishData, readoption);
logdetails("Finished the activity");
csClient.Close();
}
}