Windows Workflow Foundation Guy Burstein Senior Consultant Advantech – Microsoft Division http://blogs.microsoft.co.il/blogs/bursteg WF - Basic Concepts Visual Studio Designer Concepts Workflow Activities Host Components Base Activity Library Runtime Engine Runtime Services Visual Designer Host Process A Workflow Activity Windows Workflow Foundation Base Activity Library Workflow Runtime Engine Runtime Services Building a Simple Workflow Recruitment Workflow Challenges “Recruitment may take several weeks and even months…” “Recruiting one applicant may be very different from the other…” “What is the status of this applicant and what its the next step?” Flexible Long Running & Stateful Transparency Long Running Processes Recruitment Manager Candidate CV Technical Interviewers Manager Persistence Service By Default – Workflows run without persistence Plug in the persistence service using code or configuration. Out of the Box SqlPersistenceService Create your custom persistence services Database Workflow Windows Workflow Foundation Runtime Engine Runtime Services Persistence Service Long-Running Processes Workflow (Custom) Activities Activities are the building blocks of workflows The unit of execution and re-use Out of the box Activities get you started… Write custom activities for modeling advanced control flows modeling various workflow styles integrating with technologies aligning with standards Building Customs Activities Fault Handling Many causes for exceptions during run-time Fault Handling used to cleanup partial and unsuccessful work. WF Fault Handling consists: Fault Handlers Transactions Compensation Transactions and Fault Handling State Machine Workflows Driven by external events Unpredictable sequence of events Many alternative business paths Composed of States, Events, Actions and Transitions Infrastructure to query and interact with a workflows instance Skip And Rework S1 S2 S3 S4 Example: Recruitment State Machine Waiting For CV On CV Received On Evaluated Active On Sent to Customer Waiting for Customer On Approved On Sent to Manager Waiting for Manager On Approved Completed State Machine Workflow Tracking Service Provide consistent and reliable reporting Past, Present and Future Key Indicators Auditing / Monitoring Specify, capture, store, and query Track workflow, activity, user events and data Use OOTB SqlTrackingService or a custom tracking service Providing Application Transparency Business Rules and Conditions Added Value Modeling Power, Approachability, Ease of Change Terminology Conditions, Rules, RuleSet Rule-Driven Activities Rule1 Step1 Data Rule2 IF-Else, While, Custom Activities. PolicyActivity Can use Rules API outside Workflow Step2 Use Conditions to Decide how to Handle Apply Policy to Validate CV Policy to determine CV Routing Workflow Rules! Dynamic Update Step2 Step4 Step1 Step3 Respond to unforeseen events, circumstances. Apply changes to running instances: Step5 Step6 Add / Remove activities Change conditions (only if declarative). Workflow Changes must be Valid Must be validated by all activities Dynamic Update Condition on Root Activity Making Changes to Running Workflow Instances WF vs. Biztalk Server Biztalk Server is a product for BPM and EAI. WF is a framework for developers Ask yourselves: Do I have to change the message schema? Do I have to integrate with another systems / platforms? Do I need the ability scale out? Do I need monitoring and administration? Can use both in same solution. WF in Application Layers Validation Rules Page Flow Communication Workflows Custom Activities Runtime Services Summary More than a Drag & Drop technology A Picture’s worth more than 1000 words… Lets you focus on the business processes Use Windows Workflow Today! Resources WF Dev. Center http://msdn2.microsoft.com/enus/netframework/aa663328.aspx WF Community Site http://wf.netfx3.com WF MSDN Forum http://forums.microsoft.com/MSDN/ShowFo rum.aspx?ForumID=122&SiteID=1 My Blog http://blogs.microsoft.co.il/blogs/bursteg Guy Burstein Senior Consultant Advantech – Microsoft Division http://blogs.microsoft.co.il/blogs/bursteg
© Copyright 2026 Paperzz