Skip to content

CancelWorkflow should complete WF in Canceled and not in Closed state #45

@lmagyar

Description

@lmagyar

When the workflow cancels itself due to an unhandled exception in a ReceiveRequestSendResponseScope, the completion state of the workflow is Closed nod Canceled.

If we let the exception to buble up, and a real OnUnhandledException event occurs, that schedules workflow cancellation after the Idle event, the completion state will be correct.

I suppose, there is missing a context.MarkCanceled(); statement somewhere in this activity that prevents the default cancellation of the root activity to finally make Canceled it's state instead of Closed. The TaskAsyncNativeActivity turns off default Cancellation, if cancellation finally happens, MarkCanceled should be called somewhere.

See: http://blogs.msdn.com/b/carlos/archive/2013/02/06/wf4-workflow-foundation-4-understanding-cancellation.aspx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions