コード例 #1
0
        private static IEnumerable <string> GetInboundActivityPathInternal(this WorkflowExecutionContext workflowExecutionContext, string activityId, string startingPointActivityId)
        {
            foreach (var connection in workflowExecutionContext.GetInboundConnections(activityId))
            {
                // Circuit breaker: Detect workflows that implement repeating flows to prevent an infinite loop here.
                if (connection.Source.Activity.Id == startingPointActivityId)
                {
                    yield break;
                }

                yield return(connection.Source.Activity.Id !);

                foreach (var parentActivityId in workflowExecutionContext
                         .GetInboundActivityPathInternal(connection.Source.Activity.Id !, startingPointActivityId)
                         .Distinct())
                {
                    yield return(parentActivityId);
                }
            }
        }