.NET 3.5 Development / WWF Integration in Visual Studio 2008
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
Now let's turn our attention to WWF Integration in Visual Studio 2008, and in English that means Windows Workflow Foundation. Now this is some very exciting stuff, but it is very, very different. The concept of Workflows is huge in applications like SharePoint, and in reality that's the way we live our lives and do our work. If you think about whatever happens at the company you work for, there is a definite workflow from when an order comes in the front door to who has to touch it, things have to be signed off, things have to be checked off, and this particular order moves through the company in various paths based on various control situations. And Windows Workflow allows us to program to that, so let's open Visual Studio 2008 and I just want to show you kind of how this looks, and believe me, it's funky. It's a little different way of thinking. What I want you to do is, just create a project, a New Project, I'm going to call it Workflow, and I'll just do an Empty Workflow Project and I'll click OK. Watch the hourglass for a second, and you will notice this thing set up, it'll take it a minute, and then we will go to the Solution Explorer. Now, notice all we can see is the Start Page, so the first thing I will do is right-click on Workflow Project, and I'm going to add a New Item, and one of the new items that I'm going to add, I will jump down to the Workflow area and I'm going to add a Sequential Workflow with Code Separation. I'm going to click this little button up here so you can see it. Sequential Workflow with Code Separation. And again, as you can tell, this starts to get to be a pretty deep subject and there's a lot to learn. Now, what we're going to do here is create an Application that runs based on a workflow. So if I go into the Toolbox and I'm going to pin this thing out here so that we can see it, and let me adjust this. I'll do a Windows Workflow 3.0. Here are the actual tools that we can use. What I want to do is, say, OK, I want to kick this thing off and I can call, we can call an External Method, so I'll call this, so the first thing we want to do is call an External Method that will make this thing do whatever I want it to do. So now this particular Workflow program's going to reach outside here and run an External Method on another Object. Now to do that is kind of complicated. Notice if I just double-click here it'll take me back into the Code. I actually have to add a couple of interfaces and so forth, so let's go back. Then, notice my next step is I can say, OK, what's next? So, based on something that happened here I can go back and notice I can now do If-Else, and I'm going to drag this, drop it onto that little green. that popped up, and now I have an If-Else activity, and notice I can click on this and go to Properties, change the name, OK. And I'm going to say AmountCheck, because if this particular invoice that's coming in is over a certain amount it needs to go one place, if it's not it needs to go somewhere else, OK, and so the first If-Else branch activity, so if it's over a certain amount then I need to carry on an activity and I need to just run some code, so I'll drop the code activity there, OK, I can change this Property so that I can keep up with what's going on. So, if it's over 500 then this is going to happen, and I'll change the Property here, less than 500. If it's less than 500 let's do this code. Now, I can double-click here and actually start to type the code. But you see where we're headed? Now how cool is this, because when we come back from here a year or two from now we can start to go back and look and say, well wait a minute now, this is the workflow through the company, notice OK, if it's over 500 maybe if it's in certain departments it goes to different managers, so I drag another If-Else in here and drop it and I've now nested an If-Else in there. Does that make sense? I can call an External Method to carry on that particular activity, and I can just continue to build this thing. And this is what's called Workflow Programming, and this is a Windows Workflow Project. Now, it is considerably more complex than what you're used to coding, alright? Notice, let me show you this right quick. I can get a Web Service Input, so if this happens I can tell this thing to go out and connect to a Web Service and get some information and bring it back, OK? So, I'll stop here, but anyway this is Windows Workflow. I just wanted you to see it. I wanted you to see what it looks like. This is something you need to start to investigate. People are just starting to jump on board with this. There's some really interesting stuff that can happen here, OK? So, that's just your first quick glance at Windows Workflow.
Tutorial Information
| Course: | Introduction to Microsoft Visual Studio 2008 |
| Author: | Mark Long |
| SKU: | 34008 |
| ISBN: | 1-935320-54-8 |
| Release Date: | 2009-06-26 |
| Duration: | 7 hrs / 72 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 