狠狠撸

狠狠撸Share a Scribd company logo
WINDOWS 
WORKFLOW 
FOUNDATION (WF) 
Presented by: 
William Daugherty 
Email: billsecond@yahoo.com 
Blog (outdated): myspexp.com 
Follow This on Twitter: WilliamDotNet 
6:30
My Inspiration 
6:37
WHAT IS A WORKFLOW 
? Orchestration of logic and activities 
? Visual 
? Reusable 
? Reconfigurable 
6:39
6:40
ABOUT THE WORKFLOW IN WF4 
? Rules Engine 
? State persisted to MS-SQL 
? File Extension = XAML 
? Custom Activities 
? Re-hostable 
6:41
WHEN DO YOU USE IT 
It’s a Powerful System, but when is it right? 
? When its not too powerful 
? Flexibility 
? Rich Workflow Enabled App 
6:42
WHEN DO YOU USE IT (cont.) 
It may be too powerful for your everyday apps, 
however it is very appealing! 
6:43
FIRST THINGS FIRST, THE RULES ENGINE… 
? WF Knowledge is not Required! 
6:44
A SIMPLE WORKFLOW 
? Rules won’t cut this very well! 
6:50
AN ACTIVITY OBJECT 
? WF has a basic set of activities 
? Allows you to create your own objects 
? UI with WPF 
7:00
Back to my Inspiration 
7:10
RE-HOSTABLE WORKFLOW 
? New in .NET 4.0 
? Custom Visual Studio Designer 
? Its for YOUR application! 
7:12
LONG RUNNING WORKFLOWS (Persistence) 
?Requires MS SQL 
?Saves the state of your workflow 
?MSDN Setup URL: bit.ly/1u2ZLTw 
7:20
Tips 
7:24
7:24
Questions 
7:29

More Related Content

Wf4

  • 1. WINDOWS WORKFLOW FOUNDATION (WF) Presented by: William Daugherty Email: billsecond@yahoo.com Blog (outdated): myspexp.com Follow This on Twitter: WilliamDotNet 6:30
  • 3. WHAT IS A WORKFLOW ? Orchestration of logic and activities ? Visual ? Reusable ? Reconfigurable 6:39
  • 5. ABOUT THE WORKFLOW IN WF4 ? Rules Engine ? State persisted to MS-SQL ? File Extension = XAML ? Custom Activities ? Re-hostable 6:41
  • 6. WHEN DO YOU USE IT It’s a Powerful System, but when is it right? ? When its not too powerful ? Flexibility ? Rich Workflow Enabled App 6:42
  • 7. WHEN DO YOU USE IT (cont.) It may be too powerful for your everyday apps, however it is very appealing! 6:43
  • 8. FIRST THINGS FIRST, THE RULES ENGINE… ? WF Knowledge is not Required! 6:44
  • 9. A SIMPLE WORKFLOW ? Rules won’t cut this very well! 6:50
  • 10. AN ACTIVITY OBJECT ? WF has a basic set of activities ? Allows you to create your own objects ? UI with WPF 7:00
  • 11. Back to my Inspiration 7:10
  • 12. RE-HOSTABLE WORKFLOW ? New in .NET 4.0 ? Custom Visual Studio Designer ? Its for YOUR application! 7:12
  • 13. LONG RUNNING WORKFLOWS (Persistence) ?Requires MS SQL ?Saves the state of your workflow ?MSDN Setup URL: bit.ly/1u2ZLTw 7:20
  • 15. 7:24

Editor's Notes

  1. I was looking for an open source project that allows end users to write VBA code, executing it was not a problem, but I just wanted a pro-user to be able to build code that will run when some event is triggered, but all that I found was that Microsoft use to license that type of editor, but no longer has it as an offering. Blahhh..
  2. A workflow consists of an orchestrated and repeatable pattern of business activity enabled by the systematic organization to process information. It is a sequence of operations, declared as work of a set of tasks.
  3. A simple workflow! Remember, Dot Net Rocks!
  4. When and when Not to use Workflow (WF4) Workflow may be too powerful for a small app - Too powerful for adding simple logic to a simple app When to use Workflow - When you need the flexibility to change the flow of an application, with out digging up the code each time When you have a rich and dynamic application that is capable of running an external “XAML” workflow file
  5. It’s also appealing to say that you have used Workflow. Just know that in a lot cases, it is overkill. But here is the thing… …You will learn a lot, and will get a lot of practice in designing process flows that you should know but don’t have the experience.
  6. The Rules Engine doesn’t require any general knowledge of Windows Workflow Foundation to use, however it is good only for the developer as it uses VB.NET statements. You would use this when you the programmer requires some dynamic-ness in your app… it also comes equipped with its own dialog window much like the Open File dialog. It’s good to understand, but I really don’t recommend using this for general UI. Sample File showing Rules: https://www.dropbox.com/s/vx9n2jcil7kl7gh/Demo-Rules.zip?dl=0 A great blog about the Rules Engine: http://blogs.microsoft.co.il/bursteg/2006/10/11/execute-windows-workflow-rules-without-workflow/
  7. The rules engine was nice and all, but it’s not going to cut it, because I need a bit more flexibility than that. Sample Workflow Demo: https://www.dropbox.com/s/a6pb9bvcocuoo2m/Demo-SimpleWorkflow.zip?dl=0
  8. The activity objects allow you to create your own objects, generally there is no UI, however you can use WPF to add your own UI to this activity that comes in a later conversation. Example Activity – Simple: https://www.dropbox.com/s/yz6x6d6kssykz75/ActivityObjectTest.zip?dl=0 Example Activity with WPF: https://www.dropbox.com/s/epl2gdg294z46ph/TestWorkflowWithTextBoxActivityBound.zip?dl=0
  9. So what I found instead was that someone mentioned something in a post about Re-hostable workflows. What is this? It is a way to do the same thing that I was looking to do with VBA, but allow the users to create Workflow XAML files. Not sure why, but it still does not seem to be very popular, as the only resources that I saw was mainly MSDN.
  10. Information about the Rehostable Workflow - http://msdn.microsoft.com/en-us/library/vstudio/ms733614(v=vs.90).aspx More Information about the Rehostable Workflow - http://blogs.msdn.com/b/mcsuksoldev/archive/2012/03/26/workflow-foundation-wf4-rehosting-the-workflow-designer.aspx Rehostable Workflow Download: https://code.msdn.microsoft.com/Workflow-Studio-df1d7dc0
  11. I won’t show a demo of a long running workflow here, as there will be a lot of troubleshooting, however see the following for some links to some very good examples: bit.ly/1u2ZLTw
  12. Research how SharePoint executes workflows: Event driven Timer looks for idle workflows that needs to run every minute Store your XAML files in a blob in the database so that you can set a version to the workflow. This allows you to keep running workflows running with the same version (an older version), unless you intend to interrupt the process of the workflow