PDA

Click to See Complete Forum and Search --> : How would WF work with WPF ?


chris128
Aug 11th, 2009, 07:18 PM
Its all very well and good these tutorials using simple console apps to demonstrate Workflows but unfortunately things are a bit different in the real world. With a console app you are just waiting for a single source of user input (typing something into the console) but with a windows forms, or in my case a WPF app, I dont understand how it all works. Maybe what I am thinking of is not even really possible? Basically I thought I could use WF to handle all of the business logic and processing etc in my WPF app. If I wanted to do that, would the workflow be hosted inside the WPF app or would it be a separate service/application that the WPF app 'calls' when it needs some business logic? Would the ENTIRE code base for the WPF app be done in workflow or should it just be the 'real work' with the WPF app's code still handling basic stuff?

I guess really I'm just having a hard time seeing how you would communicate between the WPF and the Workflow side of things.

Any examples would be great!

Cheers
Chris

mendhak
Aug 16th, 2009, 01:35 AM
Your WF is nothing but a business logic layer. Call a workflower activity only when you need it. So let's say you have a Createuser.cs workflow, and UpdateUser.cs. You'd only invoke those workflows when it's time to use it in your application.

Yes, the workflow manager would be hosted in your WPF app because it's the one that'll be actually invoking your activities. Remember to create a static, global instance of your workflow manager so that it's loaded and ready to use when you call it.