[英]WF4: Validate that all exit statuses of activity has transitions to other activities
我們正在嘗試改變我們的業務流程,以便通過WF4實施。 我們的業務流程如下:
我們如何在WF4中實現這一目標?
也許您可以在處理程序活動中定義所需的屬性(轉換活動)。 然后在處理程序的CacheMetadata覆蓋中,您可以驗證它們是否被提供。 在處理程序活動的Execute方法結束時,您可以使用工作流運行時計划指定的轉換活動。 類似於以下內容:
public sealed class MyHandlerActivity : NativeActivity
{
public MyHandlerActivity NextHandler
{
get;
set;
}
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
// Ensure next handler is supplied.
if (this.NextHandler == null)
{
metadata.AddValidationError("Next handler is not assigned.");
return;
}
// Let the workflow runtime that this activity could schedule another activity (the handler activity).
metadata.AddChild(this.NextHandler);
}
protected override void Execute(NativeActivityContext context)
{
// TODO: Handler should do something here.
// Schedule the next handler.
context.ScheduleActivity(this.NextHandler);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.