Hi
I am working on statemachine in WF.Invoking workflow using WorkflowApplication.
after creating instance and calling workflow by instance.Run() method.
Then instance.unload() i am calling.When run method called respective codeActivity is getting executed where i am creating the bookmarks.
But workflow aborts unexpectingly and moving to executing status.
when i keep Thread.Sleep(new TimeSpan(0,0,5)) then it is working.
My code is like this
WorkflowApplication instance = new WorkFLowApplication();
instance.store = somestorename;
instance.complete += event;
instance.run();
Thread.Sleep(new TimeSpan(0,0,5))
instance.unload();
only by keeping Thread.Sleep(new TimeSpan(0,0,5)) its working properly. i.e. executing codeactivities with some business logic and creating bookmarks.
But i think using Thread.Sleep is not correct way of design.
Even i tried with making workflowapplication as synchronous by using SynchroniseContext.
but no success...
Please help on this