Hi,
I wonder if there is some out-of-the-box support in the WF for cancelling plain activities (i.e. directly derived from System.Workflow.ComponentModel.Activity class.)
The default implementation of the CompositeActivity manages the transition into Canceling and Faulting state, respectively. However, the default implementation of the base Activity's Cancel() method does (almost) nothing; no state transition, no events fired.
I have a scenario where I need to cancel a custom activity derived from the Activity class. My custom activity may be a workflow activity (i.e. directly under the root activity) or embedded in some other CompositeActivity. The command to cancel said activity comes from the outside world and contains just enough information to identify the activity instance itself.
At the moment I call this.Cancel() from inside my activity but no transition happens. I cannot set the ActivityExecutionStatus myself because this is the scheduler's job.
I know the recommended way of cancelling a composite activity is to call CancelActivity() for the children on the composite's AEC. Now how can I grab my activity's parent AEC at run-time to invoke CancelActivity() on it Is this the recommended way of doing the cancellation for plain activities (seems a bit contrieved to me) or am I missing some crucial point
I really need that StatusChanged notification Execution -> Canceling being fired for my activity :-)
Thanks,
Aleydis