コアサービスを使用してワークフローアクティビティを公開および終了するメソッドを作成しようとしています。コンパイルエラーが発生しています。以下は私のコードです。誰かが私を訂正できますか?その緊急。
public void PublishComponent(string WorkItemId)
{
var client = new SessionAwareCoreServiceClient();
var readoptions = new ReadOptions();
ComponentData component = (ComponentData)client.Read(new TcmUri(WorkItemId), readoptions) as ComponentData;
List<IdentifiableObjectData> ItemToPublish = new List<IdentifiableObjectData>();
ItemToPublish.Add(component);
PublishInstructionData instruction = new PublishInstructionData();
PublicationTargetData pubtarget = (PublicationTargetData)client.Read(new TcmUri("tcm: 0 - 21 - 65537"), readoptions) as PublicationTargetData;
List<PublicationTargetData> target = new List<PublicationTargetData>();
target.Add(pubtarget);
client.Publish(ItemToPublish, instruction, target, PublishPriority.Normal, readoptions);
WorkItemData workitem = new WorkItemData();
workitem.Id = new TcmUri(WorkItemId);
ActivityInstanceData currentactivity = new ActivityInstanceData();
ActivityFinishData finish = new ActivityFinishData();
finish.Message="Published";
client.FinishActivity(currentactivity, finish, readoptions);
}