locked
How do I 'Idle' my workflow instance from within it.

    Question

  •  

    Here's my scenario:

     

    I have an few workflow instances (of the same type) running.  Within the workflow, I have a code activity in which I'd like to intentionally Idle the workflow.  At some later date, I want to have my process check for idle workflows and resume them.

     

    I know I could use the DelayActivity, except it seems that if I try to resume a workflow that's in the midst of a delay activity (you know the delay timeout hasn't expired), then any attempt to resume it is simply ignored.

     

    What's needed is a way to inform the runtime that my workflow is ready to be 'idled' and unloaded but from within the workflow instance itself; not by acting upon the workflow instance object from outside of it.

     

    Is this possible ?

    Friday, October 10, 2008 3:35 PM

Answers

  • Actually, it was a rhetorical question, I already knew it wasn't supported by Workflow.  I asked the qeustion so that other poor saps would realize that Windows Workflow is an immature product, and should be approached and embraced with extreme sckepticism, and caution.

    I just wish I had been provded with so many insightful tid-bits (as I have provided) before I agree to work on the project I'm on now.

    Am I bitter.....yes, you bet I am.   Yet again Microsoft polished a turd, and managed to sell it.
    Saturday, October 11, 2008 11:11 PM

All replies

  • The other ways to idle a workflow are by 1) inserting a HandleExternalEvent activity at the point in the workflow where you want it to idle and wait for your external process or 2) use a custom activity that creates a workflow queue and waits for an item to be inserted into the queue by your external process. Check out the WorkflowQueuingService for more info on #2. You wouldn't be able to do this within a CodeActivity; it has to be a separate activity that is built to wait on an event or a queue.

    Friday, October 10, 2008 4:17 PM
  • This is my whole point, I want my application to be in control of when my workflow instance is idled (and de-hydrated) and particularly when it's re-hydrated,  not some strange rules about activity timeouts, ownership timeouts and delay timeouts that frankly don't work correctly.



    Friday, October 10, 2008 8:12 PM
  • A change in your tone might help you get more assistance -- unless this post was not a request for help, but rather another complaint about how poorly designed you feel WF is.

     

    Friday, October 10, 2008 8:30 PM
  • Actually, it was a rhetorical question, I already knew it wasn't supported by Workflow.  I asked the qeustion so that other poor saps would realize that Windows Workflow is an immature product, and should be approached and embraced with extreme sckepticism, and caution.

    I just wish I had been provded with so many insightful tid-bits (as I have provided) before I agree to work on the project I'm on now.

    Am I bitter.....yes, you bet I am.   Yet again Microsoft polished a turd, and managed to sell it.
    Saturday, October 11, 2008 11:11 PM
  • Ah, the undocumented 'feature'.   

    Simply returning out of an Activity overridden Execute function with an Activity status of Executing will do the trick.  Isn't it amazing that the 'experts' didn't know this ?

    Oh, Did I mention that the SqlWorkflowPersistenceService will automatically mark your workflow as owned until the year 9999, unless you take proactive steps ?!?!?!?
    Wednesday, October 22, 2008 9:19 PM