I am using re-hosted workflows whereby the business analyst is creating the WFs. An interesting requirement raised by business is that they want an output in some matrix format (example Excel) of all the possible paths of the WFs.
Is this technically feasible as I did not find anything in the .Net framework with such functionality.
Basically, is there a way to traverse / loop through the activities in a WF?
Check this answer: Get Child Activity Subtree
Pasting the code for completeness:
public static IEnumerable<Activity> GetInnerActivities(this Activity activity)
{
var children = WorkflowInspectionServices.GetActivities(activity);
foreach (var child in children)
{
children = children.Concat(child.GetInnerActivities());
}
return children;
}
This extension method is traversing the activity tree recursively. Just adapt the code to your needs.