当前位置: 首页>>代码示例>>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;未经允许,请勿转载。