public WfCopyMainStreamContext(IWfActivityDescriptor startActDesp, IWfActivityDescriptor endActDesp, IWfTransitionDescriptor entryTransition, bool isMainStream)
 {
     this._IsMainStream            = isMainStream;
     this._StartActivityDescriptor = new WfCopyMainStreamActivityNode(startActDesp, startActDesp, true, false);
     this._EndActivityDescriptor   = endActDesp;
     this._EntryTransition         = entryTransition;
 }
        private static void FillCopyContext(WfCopyMainStreamActivityNode currentActivity, IWfActivityDescriptor endActivity, WfCopyMainStreamContext context, WfControlOperationType operationType)
        {
            foreach (IWfTransitionDescriptor transition in currentActivity.TemplateActivityDescriptor.ToTransitions.GetNotDynamicActivityTransitions())
            {
                if (context.IsElapsedTransition(transition) == false)
                {
                    IWfActivityDescriptor nextActivityDesp = transition.ToActivity;

                    if (operationType == WfControlOperationType.Return)
                    {
                        nextActivityDesp = FindNotReturnSkippedActivity(transition.ToActivity);
                    }

                    bool nextIsEndActivity = nextActivityDesp.Key == endActivity.Key;

                    IWfActivityDescriptor originalActDesp = nextActivityDesp;

                    if (context.IsMainStream)
                    {
                        originalActDesp = context.EndActivityDescriptor.FindSubsequentActivity((t, actDesp) =>
                                                                                               t.IsBackward == false && actDesp.Instance.MainStreamActivityKey == nextActivityDesp.Key);
                    }

                    WfCopyMainStreamActivityNode toActivity = new WfCopyMainStreamActivityNode(
                        nextActivityDesp,
                        originalActDesp,
                        IsSubsequentActivity(nextActivityDesp, endActivity) == false,
                        nextIsEndActivity);

                    currentActivity.ToActivities.Add(new WfCopyMainStreamSubActivityNode(transition, toActivity));

                    context.AddElapsedTransition(transition);

                    if (currentActivity.TemplateActivityDescriptor.Key != endActivity.Key)
                    {
                        FillCopyContext(toActivity, endActivity, context, operationType);
                    }
                }
            }
        }
        private static void FillCopyContext(WfCopyMainStreamActivityNode currentActivity, IWfActivityDescriptor endActivity, WfCopyMainStreamContext context, WfControlOperationType operationType)
        {
            foreach (IWfTransitionDescriptor transition in currentActivity.TemplateActivityDescriptor.ToTransitions.GetNotDynamicActivityTransitions())
            {
                if (context.IsElapsedTransition(transition) == false)
                {
                    IWfActivityDescriptor nextActivityDesp = transition.ToActivity;

                    if (operationType == WfControlOperationType.Return)
                        nextActivityDesp = FindNotReturnSkippedActivity(transition.ToActivity);

                    bool nextIsEndActivity = nextActivityDesp.Key == endActivity.Key;

                    IWfActivityDescriptor originalActDesp = nextActivityDesp;

                    if (context.IsMainStream)
                    {
                        originalActDesp = context.EndActivityDescriptor.FindSubsequentActivity((t, actDesp) =>
                            t.IsBackward == false && actDesp.Instance.MainStreamActivityKey == nextActivityDesp.Key);
                    }

                    WfCopyMainStreamActivityNode toActivity = new WfCopyMainStreamActivityNode(
                            nextActivityDesp,
                            originalActDesp,
                            IsSubsequentActivity(nextActivityDesp, endActivity) == false,
                            nextIsEndActivity);

                    currentActivity.ToActivities.Add(new WfCopyMainStreamSubActivityNode(transition, toActivity));

                    context.AddElapsedTransition(transition);

                    if (currentActivity.TemplateActivityDescriptor.Key != endActivity.Key)
                        FillCopyContext(toActivity, endActivity, context, operationType);
                }
            }
        }
예제 #4
0
 public WfCopyMainStreamSubActivityNode(IWfTransitionDescriptor fromTransition, WfCopyMainStreamActivityNode activityNode)
 {
     this._FromTransition = fromTransition;
     this._ActivityNode   = activityNode;
 }