I would like to implement all my windows application logic based on workflows.
This is, even the actions of showing forms and all possible pre and post actions.
This way I could customize an application for a customer without needing to change code...
The problem is that, as far as I know, the instance can only run on a different thread than the UI process... this way, for example, I can't open a MDIChild on a workflow...
Can I run the workflow on the same thread of the UI process
Thanks!
Alex

WWF Thread Safety on Windows Forms
Matt84
Alex - you are correct that the DefaultWorkflowSchedulerService will always use CLR ThreadPool threads - so calling directly from a workflow to a Form or Control would be bad.
One option is to use the ManualWorkflowSchedulerService - which would make it your responsibility to call RunWorkflow when your workflow needed to run.
Another is to simply use the typical techniques for ensuring access to your Controls happen on the right thread. This involves InvokeRequired and BeginInvoke/Invoke. BackgroundWorker is also another option.
Drasko
I never eard of that 'till now...
I'll try it tonight and get back here to report the results :)
Thanks!
Alex
Richard Arnoldx
MarAng
Hi!
Thank you for the quick reply.
I don't want to wrap one thread inside another... and anyway it still won't make the UI thread wait for the WF to process... sometimes I would like that...
I don't know if this is a common need out of a workflow but it can be very usefull to make what I call a "Method Flow"...
On a well organized n-tier application, with all working methods well detailed, we can customize an application with simple Drag&Drop actions on a workflow engine.
For this to work... the WF must be able to run on both Sync and Async scenarios.
I would like some more thoughs about this...
Thank you very much!
Alex