Beispiel #1
0
        private void RenderTransientListItems(HtmlTextWriter writer, WorkStep expandStep)
        {
            var expandedWorkItems = _workflowRepository.GetWorkItems(expandStep.Path).OrderBy(wi => wi.Ordinal);

            foreach (var expandedWorkItem in expandedWorkItems)
            {
                var transientPath = ExpandedWorkStep.GetTransientPath(expandStep, expandedWorkItem);
                var transientStep = _workflowRepository.GetWorkStep(transientPath);

                RenderTransientListItem(writer, transientStep, expandedWorkItem);
            }
        }
        private void RenderWorkItems(XmlWriter writer, WorkStep workStep)
        {
            writer.WriteStartElement("WorkItems");

            foreach (var workItem in _workflowRepository.GetWorkItems(workStep.Path).OrderBy(wi => wi.Ordinal))
            {
                RenderWorkItem(writer, workItem);
            }


            writer.WriteEndElement(); //WorkItems
        }
Beispiel #3
0
        public static IEnumerable <WorkItem> GetWorkItemsRecursively(this IReadableWorkflowRepository workflowRepository, WorkStep workStep)
        {
            foreach (var childWorkStep in workflowRepository.GetChildWorkSteps(workStep.Path))
            {
                foreach (var workItem in GetWorkItemsRecursively(workflowRepository, childWorkStep))
                {
                    yield return(workItem);
                }
            }

            foreach (var workItem in workflowRepository.GetWorkItems(workStep.Path))
            {
                yield return(workItem);
            }
        }
        private void RenderWorkItems(TextWriter writer, WorkStep step)
        {
            var first = true;

            foreach (var workItem in _workflowRepository.GetWorkItems(step.Path).OrderBy(wi => wi.Ordinal))
            {
                if (!first)
                {
                    writer.Write(",");
                }

                RenderWorkItem(step, writer, workItem);

                first = false;
            }
        }
Beispiel #5
0
        public static int GetNextOrdinal(this IReadableWorkflowRepository repository, WorkItem workItem)
        {
            var workItemsInStep = repository.GetWorkItems(workItem.Path);

            return(workItemsInStep.Count() > 0 ? workItemsInStep.Max(wi => wi.Ordinal.HasValue ? wi.Ordinal.Value : 0) + 1 : 1);
        }