locked
Get List of following activities from a Custom Activity RRS feed

  • Question

  • Is it possible in a FlowChart Workflow to query the following activities as a list by a Custom Activity, before the state of the Custom Activity becomes persistent in the database?

    In order to choose one activity from the list for the user which should be done next.

    Thanks

    Thursday, June 3, 2010 7:33 PM

Answers

  • HI, Marcel

    ->"Is it possible in a FlowChart Workflow to query the following activities as a list by a Custom Activity"
    If you want to see the workflow tree, you would want to use this code block:

            private static void InspectWorkflow(Activity rootWF, int indent) {

                IEnumerator<Activity> activities = WorkflowInspectionServices.GetActivities(rootWF).GetEnumerator();

                Console.WriteLine(new string(' ', indent) + rootWF.DisplayName + " id:" + rootWF.Id);

                while (activities.MoveNext()) {

                    InspectWorkflow(activities.Current, indent + 2);

                }

            }

    Hope this helps
    Regards






    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Friday, June 11, 2010 2:12 AM
    Monday, June 7, 2010 7:13 AM

All replies

  • Hi Marcel, I'm not sure if I understand your scenario. Do you mean you want to use a custom activity to find out what activities are lined up next, and you want to allow the user to choose which of those activities to be run next? Do you mean all these activities are in FlowChart? What is your scenario? Do you mean in your scenario we don't know what activities are lined up after the custom activity during design time?
    Cecilia Leung This posting is provided "AS IS" and confers no rights or warranties.
    Friday, June 4, 2010 1:42 AM
  • HI, Marcel

    ->"Is it possible in a FlowChart Workflow to query the following activities as a list by a Custom Activity"
    If you want to see the workflow tree, you would want to use this code block:

            private static void InspectWorkflow(Activity rootWF, int indent) {

                IEnumerator<Activity> activities = WorkflowInspectionServices.GetActivities(rootWF).GetEnumerator();

                Console.WriteLine(new string(' ', indent) + rootWF.DisplayName + " id:" + rootWF.Id);

                while (activities.MoveNext()) {

                    InspectWorkflow(activities.Current, indent + 2);

                }

            }

    Hope this helps
    Regards






    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Friday, June 11, 2010 2:12 AM
    Monday, June 7, 2010 7:13 AM