SetupVisual StudioRule 18
Workflow Foundation 4
10110000 01100001What is WF4?MOV AL, 61hConsole.WriteLine(Hello!);
Why is a picture better?Highlights missing/not completed areasEasy to Understand Patterns
Simplify complex patternsMultiple BranchesRunning in parallel
NO... It’s bigger than thatSo it’s a code visualiser?
Evolution
Code ActivityRulesetWhat was lost?
IsolationWorkflow instances are isolated from the host application and each other.Workflows are not aware of information in the application other than what is passed to it.ThreadedInstances are separately threaded from your main thread.Important Concepts
Workflow Foundation Demo
New Project -> .NET 4 -> Workflow Console App -> OKDrag a WriteLine on -> Set text to "Hello"Run (Ctrl+F5)single activity issue demo: Now try drag on another writelineRemove writeline, bring on a sequence and put two writelines with different messagesAdd Argument -> Name: Firstname, Direction: In, Type: stringDrag a If on (should be only thing on surface) - condition is: String.IsNullOrWhiteSpace(FirstName)Drag a writeline to true and set text to: "Hello, stranger"Drag a writeline to false and set text to: "Hello, " & FirstNameRun it - note that it runs strangerProgram.cs - explain what is happeningChange main to (Ctrl+1):   Workflow1 workflow = new Workflow1();workflow.FirstName = "Robert";WorkflowInvoker.Invoke(workflow);RunCreate new PUBLIC class Person. Add string property FirstName. BuildDelete the current workflow argumentAdd new arguement name=person, direction=in, type=PersonChange if condition to: String.IsNullOrWhiteSpace(person.FirstName) Change else writeline: "Hello, " & person.FirstNameBuildChange main to (Ctrl+2):   Person person = new Person();person.FirstName = "Robert";  Workflow1 workflow = new Workflow1();workflow.person = person;WorkflowInvoker.Invoke(workflow);Run and fail!
Change main to (Ctrl+3):  Person person = new Person();person.FirstName = "Robert";  Dictionary<string, object> parameters = new Dictionary<string, object>();parameters.Add("person", person);  Workflow1 workflow = new Workflow1();WorkflowInvoker.Invoke(workflow, parameters);Run
Alternative Hosts
WorkflowInvoker.Invoke(new Workflow1());Alternative HostsWorkflowApplication wfApp = new WorkflowApplication(new Workflow1());wfApp.Run();Uri uri = new Uri("http://localhost:8080/Workflow");WorkflowServiceHost wfHost = new WorkflowServiceHost(new Workflow1(), uri);wfHost.Open();
Types of WorkflowSequentialState*Flow Chart* http://wf.codeplex.com/
Flow chart
Remove everything from workflowDrag a flow chart onDrag a flow decisionLink start to decisionSet decision condition to: String.IsNullOrWhiteSpace(person.FirstName)Show tooltop and tooltip stickyDrag two writelines on and link one to true and one to falsetrue writeline text: "Hello, stranger"false writeline text: "Hello, " & person.FirstNameRunLink false writeline to true writelinerun
Custom activities
Add new item -> Code activitySet value to (Ctrl+4)public InArgument<string> FirstName { get; set; }        // If your activity returns a value, derive from CodeActivity<TResult>        // and return the value from the Execute method.        protected override void Execute(CodeActivityContext context)        {            // Obtain the runtime value of the Text input argumentConsole.WriteLine(this.FirstName.Get(context));        }BuildDrag CodeActivity onto flowchart and link it to true writelinerun
Passing DataApplicationGlobal Instance VariablesDatabase, MSMQ, File, etc…Workflow
ServicesPerson person = new Person();person.FirstName = "Robert";Dictionary<string, object> parameters = new Dictionary<string, object>();parameters.Add("person", person);Workflow1 workflow = new Workflow1();StringWriter writer = new StringWriter();WorkflowInvoker invoker = new WorkflowInvoker(workflow);invoker.Extensions.Add(writer);invoker.Invoke(parameters);
Services - PersistenceApplicationApplicationWorkflow RuntimeWorkflow RuntimeWait for event2o kbInstance C20 Mb - ExecutingInstance A20Mb – 1 WeekInstance C20 Mb - ExecutingInstance B20Mb – EventDelay 1 week2o kbSQL DatabaseBeforeAfter
Services - PersistenceApplicationApplicationWorkflow RuntimeWorkflow RuntimeWait for event2o kbInstance BSleeping20KbInstance C20 Mb - ExecutingInstance A20Mb – 1 WeekInstance C20 Mb - ExecutingDelay 1 week2o kbSQL DatabaseBeforeAfter
When?Persist On IdlePersist On CommandNo Persist ZonesOptions?Persist OnlyPersist + UnloadWhere?SQLCustomServices - Persistence
Allows the WF Engine to share/store information on the workflows. Storage is, by default, to SQL but can be anywhere.Uses:Real time monitoringReviewing completed workflowsFor Bugs/supportingFor KPI/MetricsFor AuditingServices - Tracking
Security PackState MachineADO.NETMigration Kitwf.codeplex.com

More Related Content

PPTX
Functional Reactive Programming (FRP): Working with RxJS
PPTX
Legacy Code Kata v3.0
PDF
Javascript Promises/Q Library
PDF
Kotlin scope functions
ODP
Functional programming in Javascript
PPTX
Working effectively with legacy code
PDF
Twins: OOP and FP
PDF
Annotation Processing - Demystifying Java's Dark Arts
Functional Reactive Programming (FRP): Working with RxJS
Legacy Code Kata v3.0
Javascript Promises/Q Library
Kotlin scope functions
Functional programming in Javascript
Working effectively with legacy code
Twins: OOP and FP
Annotation Processing - Demystifying Java's Dark Arts

What's hot (19)

PPTX
Qtp training session IV
PDF
Callable and runnable objects in ruby
PPTX
2. Design patterns. part #2
PDF
JavaScript for real men
PPTX
Test-Driven Development Overview
PDF
Managing GraphQL servers with AWS Fargate & Prisma Cloud
PDF
Getting Comfortable with JS Promises
PPT
Operator Overloading
PPSX
Writing code that writes code - Nguyen Luong
ODP
From object oriented to functional domain modeling
PDF
How AngularJS Embraced Traditional Design Patterns
PPTX
Javascript talk
PDF
JavaScript promise
PPTX
Presentation on overloading
PPTX
2CPP10 - Polymorphism
PDF
JavaOne 2013: Java 8 - The Good Parts
PPTX
PDF
C++ Windows Forms L06 - Utlitity and Strings
PDF
JavaScript Promises
Qtp training session IV
Callable and runnable objects in ruby
2. Design patterns. part #2
JavaScript for real men
Test-Driven Development Overview
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Getting Comfortable with JS Promises
Operator Overloading
Writing code that writes code - Nguyen Luong
From object oriented to functional domain modeling
How AngularJS Embraced Traditional Design Patterns
Javascript talk
JavaScript promise
Presentation on overloading
2CPP10 - Polymorphism
JavaOne 2013: Java 8 - The Good Parts
C++ Windows Forms L06 - Utlitity and Strings
JavaScript Promises
Ad

Viewers also liked (13)

PPT
Scalable web-based workflow platform
PDF
workflow in temporal state machine v1
PDF
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
PPT
Windows Workflow Foundation
PPT
Events Workflow diagram
PDF
Workflow for XPages
PPTX
Corporate Workflow Process - Complaints and Legal Matters (illustration)
PDF
The Workflow Reference Model
PPTX
Neuro4j Workflow Overview
PDF
Djangocon 09 Presentation - Pluggable Applications
PPTX
Cognitive IBM Watson Services for Bluemix Developers
PDF
A simple workflow system using state machines
PPTX
Java workflow engines
Scalable web-based workflow platform
workflow in temporal state machine v1
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
Windows Workflow Foundation
Events Workflow diagram
Workflow for XPages
Corporate Workflow Process - Complaints and Legal Matters (illustration)
The Workflow Reference Model
Neuro4j Workflow Overview
Djangocon 09 Presentation - Pluggable Applications
Cognitive IBM Watson Services for Bluemix Developers
A simple workflow system using state machines
Java workflow engines
Ad

Similar to Workflow Foundation 4 (20)

PPT
WF 4.0 Overview
PPTX
Windows workflow foundation in .Net Framework
PPT
The Future Of Work And Workflow
PPTX
Workflow systems
PPT
PDF
Windows workflow foundation using c#
DOCX
Parallel Programming With Dot Net
PPTX
Introduction to Workflow 4
PDF
Go With The Flow
PPTX
Windows Workflow Foundation
PDF
Windows Workflow Foundation Demystified - overview and business cases
PPTX
Introduction to Windows Workflow Foundation
PPTX
Natural Laws of Software Performance
PPTX
Visual Studio 2010 and .NET 4.0 Overview
PPTX
Workflow Systems: Myths, Truths and Wishful Thinking
PPT
Windows Workflow Foundation Introduction
PPTX
Managing Content Chaos
PDF
C# Advanced L10-Workflow Foundation
PPTX
Overview of VS2010 and .NET 4.0
PPTX
WF_in_retail_banking_enterprise_systems
WF 4.0 Overview
Windows workflow foundation in .Net Framework
The Future Of Work And Workflow
Workflow systems
Windows workflow foundation using c#
Parallel Programming With Dot Net
Introduction to Workflow 4
Go With The Flow
Windows Workflow Foundation
Windows Workflow Foundation Demystified - overview and business cases
Introduction to Windows Workflow Foundation
Natural Laws of Software Performance
Visual Studio 2010 and .NET 4.0 Overview
Workflow Systems: Myths, Truths and Wishful Thinking
Windows Workflow Foundation Introduction
Managing Content Chaos
C# Advanced L10-Workflow Foundation
Overview of VS2010 and .NET 4.0
WF_in_retail_banking_enterprise_systems

More from Robert MacLean (20)

PPTX
Deno ...................................
PPTX
14 things you need to be a successful software developer (v3)
PPTX
OWASP TOP 10
PPTX
Building a µservice with Kotlin, Micronaut & GCP
PPTX
Looking at the Vue
PPTX
Kotlin 101
PPTX
Features of Kotlin I find exciting
PPTX
JavaScript Gotchas
PPTX
DevConf Survival Guide
PPTX
The state of testing @ Microsoft
PPTX
Visual Studio ❤ JavaScript
PPTX
What is new in C# 6?
PPTX
Putting the DOT in .NET - Dev/Ops/Test
PPTX
A Developer Day 2014 - Durban
PPTX
Agile lessons learned in the Microsoft ALM Rangers
PPTX
Hour of code - Train the trainer
PPTX
Building services for apps on a shoestring budget
PPTX
3 things your app API is doing WRONG
PPTX
Deno ...................................
14 things you need to be a successful software developer (v3)
OWASP TOP 10
Building a µservice with Kotlin, Micronaut & GCP
Looking at the Vue
Kotlin 101
Features of Kotlin I find exciting
JavaScript Gotchas
DevConf Survival Guide
The state of testing @ Microsoft
Visual Studio ❤ JavaScript
What is new in C# 6?
Putting the DOT in .NET - Dev/Ops/Test
A Developer Day 2014 - Durban
Agile lessons learned in the Microsoft ALM Rangers
Hour of code - Train the trainer
Building services for apps on a shoestring budget
3 things your app API is doing WRONG

Recently uploaded (20)

PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PPTX
Microsoft User Copilot Training Slide Deck
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Electrocardiogram sequences data analytics and classification using unsupervi...
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
EIS-Webinar-Regulated-Industries-2025-08.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
MuleSoft-Compete-Deck for midddleware integrations
Advancing precision in air quality forecasting through machine learning integ...
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
SGT Report The Beast Plan and Cyberphysical Systems of Control
Convolutional neural network based encoder-decoder for efficient real-time ob...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Microsoft User Copilot Training Slide Deck
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Comparative analysis of machine learning models for fake news detection in so...
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Module 1 Introduction to Web Programming .pptx
Improvisation in detection of pomegranate leaf disease using transfer learni...

Workflow Foundation 4