I'm writing a custom activity and I wonder what's the basic difference
between a Workflow.ComponentModel.Activity-derived activity and a
Workflow.Activities.SequenceActivity-derived one.
Activities.SequenceActivity is the default activity base type (as it is the one that is easiest to use). The SendMailActivity doesn't implement a sequence of other activities but instead has custom code to send mail hence it is derive from Activity instead.
All activities derive from Activity. The implementation makes no assumptions about the behaviour/design.
A sequence activity executes a set of sub-activities. If you derive from sequence activity you can use the designer to string together a set of activities. When a workflow makes use of your sequence activity it will embed the sequence in the workflow (i.e. visually you get to see the sub-activities). If this visual interface is a problem you can override the designer for your activity so that the implementation is obscurred.
thank you for answering. But I'm still a bit confused about when to use ComponentModel.Activity or Activities.SequenceActivity.
E.g. in Lab2 "Creating Custom Activities" (SendMailActivity) the
instructions tell me to change the Base class of the custom activity
from Activities.SequenceActivity to ComponentModel.Activity. Why
Workflow.ComponentModel.Activity / Workflow.Activities.SequenceActivity
JulyBetaDoesntWork
beedub80
Juergen,
All activities derive from Activity. The implementation makes no assumptions about the behaviour/design.
A sequence activity executes a set of sub-activities. If you derive from sequence activity you can use the designer to string together a set of activities. When a workflow makes use of your sequence activity it will embed the sequence in the workflow (i.e. visually you get to see the sub-activities). If this visual interface is a problem you can override the designer for your activity so that the implementation is obscurred.
Hope that helps,
David.
Expert
thank you for answering. But I'm still a bit confused about when to use ComponentModel.Activity or Activities.SequenceActivity.
E.g. in Lab2 "Creating Custom Activities" (SendMailActivity) the instructions tell me to change the Base class of the custom activity from Activities.SequenceActivity to ComponentModel.Activity. Why
Juergen