idle state

How is possible to put StateMachine workflow to be idled, without activites like delay

I want to use persistance storege for fail over. Becasue that, I want to define my persistance points. I try with:

WorkflowInstance inst = theRuntime.CreateWorkflow(type);
inst.EnqueueItemOnIdle();
inst.Unload();

but, EnqueueItemOnIdle doesn't necessarily persist the workflow immediately.



Answer this question

idle state

  • Byron118766

    workflow state is also persisted at the end of a transaction scope or after an activithy marked with the PersistOnClose attribute specified on it. So, you could put this attribute on your activity, use transactions (though I wouldn't immediately recommend that for persistence only) or use delays/events as persitence points.

    I don't think the method you are using is intended for what you think it is. Enqueing is about sending data to the workflow, not making it go idle. The workflow will go idle while waiting for input. The unload should persist it, but again, you need to be somewhere in the workflow where you can go idle.

    Matt



  • idle state