delay driven event on a state

I'm sure i'm overlooking this, but how do you put a delay driven event onto a state

I'm trying to design a state machine workflow such that if the workflow has been in the State for more than X hours or days, to fire an event (causing a state transition).

This is logic specific to the design of the workflow.  Some states might need this, others not, in some workflows, not others.

Thanks :)


Answer this question

delay driven event on a state

  • Fahad349

    Tom,

    You suggested: In a timer driven state change, you create a EventDrivenActivity on the state, then add a Delay followed by a SetState (no handleExternalEvent). So...what do you mean: "if you do decide to fire the event" (since there'd be no handle event, and thus no event to fire)

  • athansia

    EventDriven activities require that their first child is an IEventActivity, which a Delay activity is. When the timeout completes there is no need to fire an event to transition, you can just use a SetStateActivity. If you do decide to fire the event and it is calling back into the same workflow, make sure you set the WaitForIdle property on the ExternalDataEventArgs. If you don't then you will probably get an EventDeliveryFailureException.

  • Pranshu

    In your original post you were saying you would fire an event to cause the state transition, that is what I was talking about.

  • delay driven event on a state