The document discusses the Windows Workflow Foundation (WF), which allows for the orchestration of logic and activities through a visual and reusable workflow. It can be used to create rules engines and long-running workflows that are persisted to a SQL database. While powerful, WF may be overkill for everyday apps but is appealing for rich workflow-enabled apps. The document covers the basics of the rules engine, activities, and re-hosting workflows in custom Visual Studio designers.
1 of 16
Download to read offline
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
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..
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.
A simple workflow!
Remember, Dot Net Rocks!
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
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.
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/
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
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
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.
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
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
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