Esempio n. 1
0
        public static bool IsInExpandStep(this IReadableWorkflowRepository repository, WorkItem workItem, out WorkStep expandStep)
        {
            expandStep = null;
            bool isInExpandStep = repository.GetWorkStep(workItem.Path).Type == WorkStepType.Expand;

            if (isInExpandStep)
            {
                expandStep = repository.GetWorkStep(workItem.Path);
            }

            return(isInExpandStep);
        }
 public void Render(Stream stream, string path)
 {
     if (string.IsNullOrEmpty(path) || WorkStep.Root.Path == path)
     {
         Render(stream, WorkStep.Root);
     }
     else
     {
         var workStep = _workflowRepository.GetWorkStep(path);
         Render(stream, workStep);
     }
 }
Esempio n. 3
0
        public static bool IsChildOfExpandedWorkItem(this IReadableWorkflowRepository workflowRepository, WorkItem item)
        {
            if (item.Parent == null)
            {
                return(false);
            }

            var parent   = workflowRepository.GetWorkItem(item.Parent.Id);
            var workStep = workflowRepository.GetWorkStep(parent.Path);

            return(workStep.Type == WorkStepType.Expand);
        }
Esempio n. 4
0
        public static WorkStep GetLeafStep(this IReadableWorkflowRepository repository, string path)
        {
            var currentWorkStep = repository.GetWorkStep(path);

            while (true)
            {
                if (currentWorkStep.Type == WorkStepType.Expand)
                {
                    break;
                }

                var subSteps = repository.GetChildWorkSteps(currentWorkStep.Path);
                if (subSteps.Count() == 0)
                {
                    break;
                }

                currentWorkStep = subSteps.OrderBy(subStep => subStep.Ordinal).ElementAt(0);
            }

            return(currentWorkStep);
        }
Esempio n. 5
0
 public static bool IsDone(this IReadableWorkflowRepository workflowRepository, WorkItem item)
 {
     return(workflowRepository.GetWorkStep(item.Path).Type == WorkStepType.End);
 }
Esempio n. 6
0
 public static bool IsParallelStep(this IReadableWorkflowRepository repository, string path)
 {
     return(!IsRoot(repository, path) && IsParallelStep(repository, repository.GetWorkStep(path)));
 }