Exemplo n.º 1
0
        private static IEnumerable <string> GetInboundActivityPathInternal(this WorkflowModel workflowModel, string activityId, HashSet <string> inspectedActivityIds)
        {
            foreach (var connection in workflowModel.GetInboundConnections(activityId))
            {
                // Circuit breaker: Detect workflows that implement repeating flows to prevent an infinite loop here.
                if (inspectedActivityIds.Contains(connection.SourceId))
                {
                    yield break;
                }

                yield return(connection.SourceId);

                foreach (var parentActivityId in workflowModel.GetInboundActivityPathInternal(connection.SourceId, inspectedActivityIds).Distinct())
                {
                    inspectedActivityIds.Add(parentActivityId);
                    yield return(parentActivityId);
                }
            }
        }