我在比基尼熱金髮和我有以下代碼Workflow Foundation的4 WorkflowApplication已完成,不會觸發
AutoResetEvent instanceUnloaded = new AutoResetEvent(false);
WFStepsActivity workflow = WorkflowFactory.Current.BuildWorkflow(workflowinstance, requestinstance.RequestInstanceID);
WorkflowApplication wf = new WorkflowApplication(workflow);
wf.InstanceStore = WFInstanceStore.GetInstanceStore();
WFStepsPersistenceParticipant persist = new WFStepsPersistenceParticipant();
wf.Extensions.Add(persist);
wf.PersistableIdle = (arg) =>
{
return PersistableIdleAction.Unload;
};
wf.Unloaded = (arg) =>
{
log.Info("WFName_" + wfsetting.Name + "_Unloaded and return.");
instanceUnloaded.Set();
};
wf.OnUnhandledException = (arg) =>
{
return UnhandledExceptionAction.Abort;
};
wf.Completed = (arg) =>
{
if (arg.CompletionState == ActivityInstanceState.Closed)
{
persist.WorklflowCompleted = true;
}
};
wf.Run();
instanceUnloaded.WaitOne();
return persist.WorklflowCompleted;
其中WFStepsActivity只是我們從設置建立胡亞蓉結構。 創建書籤時,工作流程當前結束。
context.CreateBookmark(context.WorkflowInstanceId.ToString(),new System.Activities.BookmarkCallback(OnResumeBookmark));
問題出在書籤創建後,wf.Completed從未觸發。
想要檢查創建書籤時是否觸發Complete。
據我所知完整的事件將是如果u取消觸發,終止
不是它假設一旦書籤工作流站,這將觸發事件?
謝謝你們!乾杯