Sequence vs. CompositeActivity Guidance

Hello,

Could anyone please provide some guidance as to when to create a custom activity that is based on Sequence and when to base it on CompositeActivity   I see some of the same WWF activities are based on Sequence while other derive from CompositeActivity.  I'm not clear on how to decide what to use in which situations.

Thanks,

Notre



Answer this question

Sequence vs. CompositeActivity Guidance

  • RSNovice

    Thank Arjun.  So, would it be correct to say that while both activies based on CompositeActivity and Sequence can contain child activities, the difference is that the Sequence automatically executes its child activities in a strict sequence while the CompositeActivity doesn't automatically execute its child activities automatically, but rather in whatever custom order the container activities's Execute method prescribes

    Does CompositeActivity provide any additional flexibility in terms of the design time experience compared with a custom activity based on Sequence   I know you can associate a design attribute to either one, I'm wondering if one provides more flexibility than the other.

    Anything else that might help decide which to use

    Thanks,

    Notre


  • bob_monkhouse_book_of_gags

    Notre,

    In most cases, where you want the children of the activity to be executed sequentially, a Sequence would work fine.  If, however, more complex or advanced execution behavior is needed, then the CompositeActivity is the right base class to use.  Consider, as an example, the ForEach activity, or some custom activity that executed its children out of order.

    Arjun


  • jjrdk

    Notre,

    This is correct.  A CompositeActivity would not execute any of its children, by default.  You'll need to write your on Execute method to this.  As for designers, the CompositeActivity doesn't have any special designer, so you'll essentially need to create one from scratch.  With the Sequence, you can leverage the already created designer.

     

    Arjun


  • Sequence vs. CompositeActivity Guidance