locked
Old version persisted workflow service with completed delay RRS feed

  • Question

  • I'm developing several workflow services hosted in IIS 7.5 using Visual Studio 11 Beta. I'm using SqlWorkflowInstanceStore for workflow persistence. I'm not using AppFabric because there is no AppFabric for WF 4.5, instead I've developped a very simplified Wokflow Management Service http://msdn.microsoft.com/en-us/library/ff383397.aspx. Because we are in the developing phase, we change workflow service logic without changing workflow version. As a result we have old persisted workflows that cannot be loaded, because the assembly changed, some of them have completed delays.

    The Workflow Management Service waits for workflow instance store events, specifically for activatable workflows, and activate them. Old persisted workflows with completed delay are activatable, but never activate, as a result the Workflow Management Service always receive activatable workflow event when it ask for it, causing a performance penalty, because it queries once and once again for activatable workflows and tries to activate them.

    I've not found a way to detect unloadable workflows. No error is raised when WorkflowServiceHost tries to load the workflow and it can't.

    What can I do with these crap workflows that pollutes my system?

    Thank you.

    Wednesday, May 9, 2012 1:02 PM

Answers

  • Hi,

    Is it possible to configure the unhandled exception behavior to achieve what you want? I don't think there is a way to detect unloadable workflow, if there is no error raised when WorkflowServiceHost tries to load the workflow with incorrect workflow definition.

    An approach here to deal with the crap workflows might be dynamically update the workflow, but it requires you modify the original workflow via code.

    http://code.msdn.microsoft.com/An-Introduction-to-Dynamic-01304b61

    In addition, if you can identify the unloadable workflows by the value of property in workflow instance, you might deserialize Instance Data properties

    http://msdn.microsoft.com/en-us/library/ee960223.aspx

    Friday, May 11, 2012 8:50 AM

All replies

  • Hi,

    Is it possible to configure the unhandled exception behavior to achieve what you want? I don't think there is a way to detect unloadable workflow, if there is no error raised when WorkflowServiceHost tries to load the workflow with incorrect workflow definition.

    An approach here to deal with the crap workflows might be dynamically update the workflow, but it requires you modify the original workflow via code.

    http://code.msdn.microsoft.com/An-Introduction-to-Dynamic-01304b61

    In addition, if you can identify the unloadable workflows by the value of property in workflow instance, you might deserialize Instance Data properties

    http://msdn.microsoft.com/en-us/library/ee960223.aspx

    Friday, May 11, 2012 8:50 AM
  • Hi Franconia

    I have set workflowUnhandledException to AbandonAndSuspend but that doesn't seem to help.

    Dynamic update is an option, but I would prefere just delete the workflow.

    Thank you for the links.

    Friday, May 11, 2012 5:11 PM