How can I query StateMachineWorkflowInstance before the WF idles

I would like to retrieve the name of the State that a current State Machine Workflow Instance is in. The StateMachineWorkflowInstance class works fine for this once the WF idles, but I am unable to use it to retrieve the current State when a WF instance is first started. The idea is that I start a WF and then query the State. Can this be done with StateMachineWorkflowInstance or will it require tracking?
[408 byte] By [Cory.Isakson] at [2007-12-21]
# 1

The StateMachineWorkflowInstance is using tracking underneath to find out the current state.You could add a CallExternalMethodActivity to a StateInitializationActivity added to each state and have it send the host the state’s name, and any other information you want.Unless you have execution logic in your state initialization that causes a transition to another state, a state will become idle immediately after the state initialization completes execution.You could just use the call external when you do cause a transition in the state initialization and let the StateMachineWorkflowInstance use tracking to find out the rest of the time.

TomLake at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified