Пример #1
0
        private static List <TransitionInfo> AdaptTransitionProperties(IWfProcess procInstance, IWfActivity instanceAct)
        {
            List <TransitionInfo> result          = new List <TransitionInfo>();
            IWfActivityDescriptor instanceActDesc = instanceAct.Descriptor;

            foreach (IWfTransitionDescriptor transition in instanceActDesc.ToTransitions)
            {
                var link = new TransitionInfo()
                {
                    Key             = transition.Key,
                    Name            = transition.Name,
                    Enabled         = transition.Enabled,
                    FromActivityKey = instanceActDesc.Key,
                    ToActivityKey   = transition.ToActivity.Key,
                    WfReturnLine    = transition.IsBackward,
                    IsPassed        = false
                };

                var fromAct = procInstance.Activities.FindActivityByDescriptorKey(link.FromActivityKey);
                var toAct   = procInstance.Activities.FindActivityByDescriptorKey(link.ToActivityKey);

                if (fromAct != null && toAct != null)
                {
                    if ((fromAct.Status == WfActivityStatus.Completed || fromAct.Status == WfActivityStatus.Running || fromAct.Status == WfActivityStatus.Pending) &&
                        (toAct.Status == WfActivityStatus.Completed || toAct.Status == WfActivityStatus.Running || toAct.Status == WfActivityStatus.Pending))
                    {
                        link.IsPassed = true;
                    }
                }

                result.Add(link);
            }

            return(result);
        }
Пример #2
0
        private static List <TransitionInfo> AdaptMainStreamTransitionProperties(IWfActivityDescriptor instanceActDesc)
        {
            List <TransitionInfo> result = new List <TransitionInfo>();

            foreach (var tran in instanceActDesc.ToTransitions)
            {
                var link = new TransitionInfo()
                {
                    Key             = tran.Key,
                    Name            = tran.Name,
                    Enabled         = tran.Enabled,
                    FromActivityKey = instanceActDesc.Key,
                    ToActivityKey   = tran.ToActivity.Key,
                    WfReturnLine    = tran.IsBackward,
                    IsPassed        = false
                };

                result.Add(link);
            }

            return(result);
        }
Пример #3
0
        private static List<TransitionInfo> AdaptMainStreamTransitionProperties(IWfActivityDescriptor instanceActDesc)
        {
            List<TransitionInfo> result = new List<TransitionInfo>();

            foreach (var tran in instanceActDesc.ToTransitions)
            {
                var link = new TransitionInfo()
                {
                    Key = tran.Key,
                    Name = tran.Name,
                    Enabled = tran.Enabled,
                    FromActivityKey = instanceActDesc.Key,
                    ToActivityKey = tran.ToActivity.Key,
                    WfReturnLine = tran.IsBackward,
                    IsPassed = false
                };

                result.Add(link);
            }

            return result;
        }
Пример #4
0
        private static List<TransitionInfo> AdaptTransitionProperties(IWfProcess procInstance, IWfActivity instanceAct)
        {
            List<TransitionInfo> result = new List<TransitionInfo>();
            IWfActivityDescriptor instanceActDesc = instanceAct.Descriptor;

            foreach (IWfTransitionDescriptor transition in instanceActDesc.ToTransitions)
            {
                var link = new TransitionInfo()
                {
                    Key = transition.Key,
                    Name = transition.Name,
                    Enabled = transition.Enabled,
                    FromActivityKey = instanceActDesc.Key,
                    ToActivityKey = transition.ToActivity.Key,
                    WfReturnLine = transition.IsBackward,
                    IsPassed = false
                };

                var fromAct = procInstance.Activities.FindActivityByDescriptorKey(link.FromActivityKey);
                var toAct = procInstance.Activities.FindActivityByDescriptorKey(link.ToActivityKey);

                if (fromAct != null && toAct != null)
                {
                    if ((fromAct.Status == WfActivityStatus.Completed || fromAct.Status == WfActivityStatus.Running || fromAct.Status == WfActivityStatus.Pending) &&
                        (toAct.Status == WfActivityStatus.Completed || toAct.Status == WfActivityStatus.Running || toAct.Status == WfActivityStatus.Pending))
                    {
                        link.IsPassed = true;
                    }
                }

                result.Add(link);
            }

            return result;
        }