Exemplo n.º 1
0
        private WorkflowStep IterateParents(int id, string name)
        {
            //todo: filter out circular paths
            var upstream = WorkflowBuilder.GetUpstreamSteps(id);

            foreach (var parent in upstream)
            {
                if (parent.Name == name)
                {
                    return(parent);
                }
            }

            foreach (var parent in upstream)
            {
                var result = IterateParents(parent.Id, name);
                if (result != null)
                {
                    return(result);
                }
            }
            return(null);
        }