當前位置: 首頁>>代碼示例>>C#>>正文


C# ActivityExecutionContext.FaultActivity方法代碼示例

本文整理匯總了C#中ActivityExecutionContext.FaultActivity方法的典型用法代碼示例。如果您正苦於以下問題:C# ActivityExecutionContext.FaultActivity方法的具體用法?C# ActivityExecutionContext.FaultActivity怎麽用?C# ActivityExecutionContext.FaultActivity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ActivityExecutionContext的用法示例。


在下文中一共展示了ActivityExecutionContext.FaultActivity方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ExceptionOccured

 internal void ExceptionOccured(Exception exp, Activity currentActivity, string originalActivityId)
 {
     if (this.ThrownException != exp)
     {
         this.ThrownException = exp;
         this.activityThrowingException = currentActivity.QualifiedName;
         originalActivityId = currentActivity.QualifiedName;
     }
     else
     {
         originalActivityId = this.activityThrowingException;
     }
     Guid contextGuid = ((ActivityExecutionContextInfo) ContextActivityUtils.ContextActivity(currentActivity).GetValue(Activity.ActivityExecutionContextInfoProperty)).ContextGuid;
     Guid empty = Guid.Empty;
     if (currentActivity.Parent != null)
     {
         empty = ((ActivityExecutionContextInfo) ContextActivityUtils.ContextActivity(currentActivity.Parent).GetValue(Activity.ActivityExecutionContextInfoProperty)).ContextGuid;
     }
     this.FireExceptionOccured(exp, currentActivity.QualifiedName, originalActivityId, contextGuid, empty);
     using (new ServiceEnvironment(currentActivity))
     {
         using (this.SetCurrentActivity(currentActivity))
         {
             using (ActivityExecutionContext context = new ActivityExecutionContext(currentActivity, true))
             {
                 context.FaultActivity(exp);
             }
         }
     }
     this.RollbackTransaction(exp, currentActivity);
     if ((currentActivity is TransactionScopeActivity) || (exp is PersistenceException))
     {
         this.BatchCollection.RollbackBatch(currentActivity);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:35,代碼來源:WorkflowExecutor.cs

示例2: ExceptionOccured

        internal void ExceptionOccured(Exception exp, Activity currentActivity, string originalActivityId)
        {
            Debug.Assert(exp != null, "null exp");
            Debug.Assert(currentActivity != null, "null currentActivity");
            // exception tracking work
            //
            if (this.ThrownException != exp)
            {
                // first time exception
                this.ThrownException = exp;
                this.activityThrowingException = currentActivity.QualifiedName;
                originalActivityId = currentActivity.QualifiedName;
            }
            else
            {
                // rethrown exception
                originalActivityId = this.activityThrowingException;
            }
            Guid contextGuid = ((ActivityExecutionContextInfo)ContextActivityUtils.ContextActivity(currentActivity).GetValue(Activity.ActivityExecutionContextInfoProperty)).ContextGuid;
            Guid parentContextGuid = Guid.Empty;
            if (null != currentActivity.Parent)
                parentContextGuid = ((ActivityExecutionContextInfo)ContextActivityUtils.ContextActivity(currentActivity.Parent).GetValue(Activity.ActivityExecutionContextInfoProperty)).ContextGuid;
            this.FireExceptionOccured(exp, currentActivity.QualifiedName, originalActivityId, contextGuid, parentContextGuid);

            // notify the activity.
            //
            using (new ServiceEnvironment(currentActivity))
            {
                using (SetCurrentActivity(currentActivity))
                {
                    using (ActivityExecutionContext executionContext = new ActivityExecutionContext(currentActivity, true))
                        executionContext.FaultActivity(exp);
                }
            }

            // transaction and batching clean-up on the activity that handles the exception
            this.RollbackTransaction(exp, currentActivity);
            if ((currentActivity is TransactionScopeActivity) || (exp is PersistenceException))
                this.BatchCollection.RollbackBatch(currentActivity);
        }
開發者ID:uQr,項目名稱:referencesource,代碼行數:40,代碼來源:WorkflowExecutor.cs

示例3: RaiseException

 public void RaiseException(Exception e, Activity activity, string responsibleActivity)
 {
     // No tracking needed
     using (SetCurrentActivity(activity))
     {
         using (ActivityExecutionContext executionContext = new ActivityExecutionContext(activity, true))
         {
             executionContext.FaultActivity(e);
         }
     }
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:11,代碼來源:InteropExecutor.cs


注:本文中的ActivityExecutionContext.FaultActivity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。