Exemple #1
0
        private NextActivityKey _Execute(WorkflowExecutionContext context, ActivityParameterDictionary execParameters)
        {
            if (Parent != null && !Parent._initialized)
            {
                Parent._Initialize(context);
            }
            _Initialize(context);
            var originalСontextTracking = context.Tracking;

            if (!Tracking)
            {
                context.Tracking = false;
            }
            var originalСontextPriority = context.Priority;

            if (Priority > originalСontextPriority)
            {
                context.Priority = Priority;
            }
            NextActivityKey res = null;

            try
            {
                context.ActivityExecuting(this);
                res = ExecutionMethodCaller.Call(context, execParameters);
                context.ActivityExecuted(this);
            }
            catch (ActivityExecutionInterruptException ex)
            {
                context.ActivityExecutionInterrupted(ex);
            }
            catch (Exception ex)
            {
                var interruptException = ex.InnerException as ActivityExecutionInterruptException;
                if (interruptException != null)
                {
                    context.ActivityExecutionInterrupted(interruptException);
                }
                else
                {
                    throw new ActivityExecutionException("Ошибка выполнения действия", ex, this, context);
                }
            }
            finally
            {
                context.Tracking = originalСontextTracking;
                context.Priority = originalСontextPriority;
                _Uninitialize(context);
            }
            return(res);
        }
Exemple #2
0
        private static Activity GetNextActivity(Activity currentExecutingActivity, NextActivityKey nextActivityKey)
        {
            var nextActivities = currentExecutingActivity.NextActivities;

            if (nextActivities.ContainsKey(nextActivityKey))
            {
                return(nextActivities[nextActivityKey]);
            }
            if (nextActivities.ContainsKey(NextActivityKey.DefaultNextActivityKey))
            {
                return(nextActivities[NextActivityKey.DefaultNextActivityKey]);
            }
            return(currentExecutingActivity.FollowingActivity);
        }
Exemple #3
0
 public ReturnActivity(NextActivityKey result)
 {
     Result   = result;
     Name     = string.Format(NAME_FORMAT_STRING, result);
     Tracking = false;
 }
Exemple #4
0
 public ReturnActivity(NextActivityKey result)
 {
     Result = result;
     Name = string.Format(NAME_FORMAT_STRING, result);
     Tracking = false;
 }