Windows Workflow Foundation 3
When do activities CANCEL and How do i force activities to cancel state?
I see cancellationhandleractivity on any compositeactivity type. I try everything, but i didn't see activity in cancellationhandleractivity box run. So, When do they run? and Can i force activity to run cancellationhandleractivity or change state to cancel? How? I see cancel method in all activity but it is used by workflowruntime. It seems developers can't touch or reach it. Is it true? ps. dotNetFramework 3.5 Thank for your kind.
Hi, "The CancellationHandlerActivity activity contains cleanup logic for a composite activity that is canceled before all the composite activity's child activities are finished executing. A CancellationHandlerActivity activity cannot exist on its own; it is always associated with another activity. For example, a ListenActivity activity or a ConditionedActivityGroup activity can have multiple child branch activities executing at once. A specific condition, such as an arriving message, can cause the entire activity to close immediately, before all the child activities are finished executing. The parent activity then cancels the execution of all uncompleted child activities, and their corresponding CancellationHandlerActivity activity is called to perform the cleanup logic defined there." http://msdn.microsoft.com/en-us/library/aa349442.aspx ->and Can i force activity to run cancellationhandleractivity or change state to cancel? How? ->I see cancel method in all activity but it is used by workflowruntime. It seems developers can't touch or reach it. Is it true? We can only cancel an activity from parent, you can refer to: ActivityExecutionContext.CancelActivity Method http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.activityexecutioncontext.cancelactivity.aspxLeo Tang [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Related Links
DelayActivities and useActiveTimer
Custom Persistence and CompletedScope table
WorkFlow - timer
EnqueueItem for transactional delivery of data
WorkFlowRuntime with events (ASp.Net)
Workflow on the fly
Windows Workflow and ASP.Net
State Machine "Undo" to previous state
Bind workflow property to a read-only activity property
Developing an application for a service support provider.
WorkflowRuntime.CreateWorkflow Performance
Access sequential workflow dependency property from custom activity
Access to workflow queues from external processes
Persiste in a custom activity
Workflow re-activates on Final State when using OnWorkflowItemChanged Event
Windows WorkFlow Foundation: Cannot add a new state in between two existing states.