SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
State Machine Workflows: Esoteric
Techniques or Something Everyone Should Be
Using?
Setting Expectations
• This session is about workflow design

– I want to advocate a way of thinking
– Plenty of resources exist for coding; this isn’t one of them

• If you already understand state machines, and you already
like them, this session might not be for you
• I will indeed use Nintex Workflow for some demos
– I know it well and can illustrate a concept quickly with it
– But this is not a session pitching Nintex Workflow
– Other products can do state machines, too
Consider A Press Release
•
•
•
•

Author
Management
Legal department
Publisher
You May Think Like This
Or Perhaps This
What About
• Getting professional editorial help?
• Other outcomes?
– e.g., Legal wants to clarify a point with
Management
How About This?
Authoring

Manager
Approval

Legal
Review

Publishin
g
How About This?
Authoring

Manager
Review

Legal
Review

Publishin
g

(re)Submit?

Choice

Choice

Deploy to Public
SharePoint Site

No
End

Yes
Mgr
Rev

Request
changes
Auth

Forward
to Legal
Mgr
Apr

Request
changes
Auth

Request
clarification

Approve

Pub

Mgr
Apr

End
Or Even This?
Authoring

Manager
Review

PR
Polishing

Legal
Review

Publishin
g

(re)Submit?

Choice

Choice

Choice

Deploy to Public
SharePoint Site

No
End

Yes
Mgr
Rev

Request
changes
Auth

Approve
PR

Draft Changes
Approve

Request
changes

Request
clarification

Auth

Auth

Approve
Request
clarification

Leg

Pub

Mgr
Apr

PR

End
State Machines
• States
• Events
• Transitions

State

Switched On
Event
Transition

Button
Click

Transition

Button
Event
Click

Switched Off
State
•

State Machines vs. Sequential
Workflow

Sequential Workflow
–
–
–
–
–

•

Predictable
Wait, then march forward
Workflow is in control of the process
Most decisions happen within the workflow
Workflow’s job is to direct

State machine workflow
–
–
–
–
–

Event driven
No concept of “waiting”; workflow is in one state until it isn’t
Actions are in control of the process
Most decisions happen outside of the workflow
Workflow’s job is to govern
Bug Tracking Example
How you think it works

• Tester opens bug
• Developer fixes bug
• Tester approves fix
Bug Tracking Example
What really happens

• A tester opens a bug, and assigns it to Bill.
• Bill says, “no not me, this is Clive’s”, and reassigns the bug to him.
• Or Bill says, “this tester is not in this case quite correct” (or words
to that effect), and rejects the bug as nonsense.
• Or Bill asks the tester for clarifying information.
• Or even, if he’s in a good mood, Bill fixes it and hands it back to the
tester.
– Or, if the original tester is out, another tester.

• Or the tester withdraws an erroneous bug (surely not)
• And so on.
Bug Tracking Example: Sequential
Tester T creates instance of bug workflow
T adds bug details
T assigns to developer D
LabelB:
Switch
D assigns to developer E:
Goto LabelB
D rejects bug to T:
Switch
T accepts rejection:
Exit
T updates bug and assigns to developer F:
Goto LabelB
End Switch
D requests info from T:
T submits info
Goto LabelB
D submits solution to T:
GoTo LabelB
T withdraws bug:
Exit
End Switch
Bug Tracking Example: State Machine
•

•

•

•
•

•

State: Initial
– Action: T adds bug details
– Action: T assigns to developer D; new state = Fixing
State: Fixing
– Action: D assigns to developer E
– Action: D rejects bug to T; new state = Rejected
– Action: D requests info; new state = Pending Info
– Action: D submits solution; new state = Pending Approval
– Action: T withdraws bug; new state = Closed
State: Rejected
– Action: T accepts rejection; new state = Closed
– Action: T updates bug and assigns to developer F; new state = Fixing
State: Pending Info
– Action: T submits info; new state = Fixing
State: Pending Approval
– Action: T rejects solution; new state = Fixing
– Action: T accepts solution; new state = Closed
State: Closed
Even “Obvious” Sequential Processes
Can Be Secret State Machines
• Expense approval
– Usually, if any problem, reject and restart
• No way to track how long it takes to get an eventual outcome

– Model back-and-forth into the workflow
• Escalation
• Return for clarification

• Leave approval
– Allows negotiation to be factored in to the process
When Do You Use a State Machine?
• When you need
– Flexibility

• You can add new states with minimal impact
• You can modify steps within a state without fear of wide impact

– Visibility

• The more complex, the harder sequential workflows are to read
• Harder to visualize graphically, but very easy to read a log

– Control

• Counterintuitive
• You can easily define how to skip steps
• You can more easily manually induce a revert-to-state, skip-to-state

• Actually, almost always
Why State Machines are Useful
• We want workflows to follow a predictable path
– We find that real-world demands get in the way

• Without state machines, you’ll wind up with:
–
–
–
–

A lot of If-Then-Else conditions
A lot of looping
Lots and lots of arrows to the point of “Spaghetti”
Graphical “goto” statements

• Most workflows actually wait for people to do something
– That’s a “decision outside of the workflow” scenario

• The current state is useful for status reporting
Sequential Activity Inside a State
• Inside of a state, sequential actions take place
–
–
–
–
–

Evaluate conditions
Transform data
Process transitions
Branch based on conditions
Assign tasks

• Technically, some of these a mini-state changes
• You can nest state machines inside of states
Sequential Flow Using State Machines
• Define the rules correctly
• State machine workflow will follow a
predictable path
• Until you need it not to 
Can Users Understand This?
• Don’t call it a “state machine”
• Call them “stages” instead of “states”
• Call it “moving back and forth” rather than
“transitions”
• Users love being able to handle exceptions
• Users love being able to change rules
Using State Machines for Exception
Handling

• Add “Error Encountered” state
• Have workflow actions change state upon exception
• Have “Error Encountered” state:
– Undo earlier work
– Create compensating actions if necessary
– Report error to process owner
Using State Machines to Restart a
Workflow Where It Last Left Off
• Add a field to a list item; leave it out of most views
– “Internal Workflow State”

• Workflow begins in “Evaulate Initial State” state
– Checks InternalWorkflowState variable
– Transitions to correct state accordingly
Can You Loop? You Can Simulate a
State Machine

• You will need:
– Variable
– Loop
– Switch

• Steps:

– Set variable to initial state immediately before loop
– Put a switch inside a loop
• Switch evaluates variable and branches accordingly

– When you need to change state, change the value of that variable and
wait for looping to occur
– Make sure at least one of the states
causes the loop to end
You Can Even Do This In SharePoint Designer
(Sort of)

• Warning – this is for entertainment purposes only
• One field to store current state
• One startup workflow, plus one workflow for each state
– Last step of each workflow sets a field value
– All state workflows started by modification to item

(except for the workflow that caused the change to take place, of course)

– Each workflow first checks state field, exits if not target state

• This isn’t practical, though

– It effectively starts all state workflows (other than the current one) with
every change
– Plays havoc with the audit trail
Windows Workflow Foundation 4.0
• Microsoft removed state machines from WF 4.0
• Introduced a Flowchart workflow type instead
– Still consisted of states
– Graphical paths between states
– Worked for many use cases

• Backlash ensued!
• Microsoft later introduced a State Machine activity
– Posted to CodePlex
– http://wf.codeplex.com/releases/view/43586
Conclusion
• State machines sound esoteric – they’re not
• State machines have genuine practical benefits
• This is a way of designing, not coding
– State machines can behave sequentially if need be
– Sequential workflows can behave like state machines if need be

• Many products can do this
• A lot of content exists to help
Questions & Discussion
References
•
•
•
•
•
•
•

http://msdn.microsoft.com/en-us/library/gg508985.aspx
http://msdn.microsoft.com/en-us/library/dd692929.aspx
http://odetocode.com/code/460.aspx
http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vssequential-workflow.html
http://vtonms.blogspot.com/2010/01/nintex-workflow-smart-restart-workflow.html
http://blogs.msdn.com/b/davegreen/archive/2005/10/20/483309.aspx
http://blogs.msdn.com/b/pravin_indurkar/archive/2005/09/25/473826.aspx

Más contenido relacionado

La actualidad más candente

API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8José Paumard
 
Clean architecture - Protecting the Domain
Clean architecture - Protecting the DomainClean architecture - Protecting the Domain
Clean architecture - Protecting the DomainVictor Rentea
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - PerfomatixPerfomatix Solutions
 
From Spring Framework 5.3 to 6.0
From Spring Framework 5.3 to 6.0From Spring Framework 5.3 to 6.0
From Spring Framework 5.3 to 6.0VMware Tanzu
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
なんでCSSすぐ死んでしまうん
なんでCSSすぐ死んでしまうんなんでCSSすぐ死んでしまうん
なんでCSSすぐ死んでしまうんHayato Mizuno
 
Singleton Design Pattern - Creation Pattern
Singleton Design Pattern - Creation PatternSingleton Design Pattern - Creation Pattern
Singleton Design Pattern - Creation PatternSeerat Malik
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean ArchitectureBadoo
 
Java version 11 - les 9 nouveautes
Java version 11 -  les 9 nouveautesJava version 11 -  les 9 nouveautes
Java version 11 - les 9 nouveautesAbdenour Bouateli
 
38475471 qa-and-software-testing-interview-questions-and-answers
38475471 qa-and-software-testing-interview-questions-and-answers38475471 qa-and-software-testing-interview-questions-and-answers
38475471 qa-and-software-testing-interview-questions-and-answersMaria FutureThoughts
 
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)William Yeh
 
Resilience4j with Spring Boot
Resilience4j with Spring BootResilience4j with Spring Boot
Resilience4j with Spring BootKnoldus Inc.
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 
Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applicationsFabricio Epaminondas
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootMikalai Alimenkou
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android DevelopmentSpeck&Tech
 
Introduction au Domain Driven Design
Introduction au Domain Driven DesignIntroduction au Domain Driven Design
Introduction au Domain Driven DesignDNG Consulting
 

La actualidad más candente (20)

API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8
 
Workshop Swift
Workshop Swift Workshop Swift
Workshop Swift
 
Builder pattern
Builder patternBuilder pattern
Builder pattern
 
Spring boot
Spring bootSpring boot
Spring boot
 
Clean architecture - Protecting the Domain
Clean architecture - Protecting the DomainClean architecture - Protecting the Domain
Clean architecture - Protecting the Domain
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - Perfomatix
 
From Spring Framework 5.3 to 6.0
From Spring Framework 5.3 to 6.0From Spring Framework 5.3 to 6.0
From Spring Framework 5.3 to 6.0
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
なんでCSSすぐ死んでしまうん
なんでCSSすぐ死んでしまうんなんでCSSすぐ死んでしまうん
なんでCSSすぐ死んでしまうん
 
Singleton Design Pattern - Creation Pattern
Singleton Design Pattern - Creation PatternSingleton Design Pattern - Creation Pattern
Singleton Design Pattern - Creation Pattern
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Java version 11 - les 9 nouveautes
Java version 11 -  les 9 nouveautesJava version 11 -  les 9 nouveautes
Java version 11 - les 9 nouveautes
 
38475471 qa-and-software-testing-interview-questions-and-answers
38475471 qa-and-software-testing-interview-questions-and-answers38475471 qa-and-software-testing-interview-questions-and-answers
38475471 qa-and-software-testing-interview-questions-and-answers
 
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
 
Resilience4j with Spring Boot
Resilience4j with Spring BootResilience4j with Spring Boot
Resilience4j with Spring Boot
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applications
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 
Introduction au Domain Driven Design
Introduction au Domain Driven DesignIntroduction au Domain Driven Design
Introduction au Domain Driven Design
 

Destacado

A simple workflow system using state machines
A simple workflow system using state machinesA simple workflow system using state machines
A simple workflow system using state machinesdhpeterson
 
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Thorsten Franz
 
workflow in temporal state machine v1
workflow in temporal state machine v1workflow in temporal state machine v1
workflow in temporal state machine v1Gordon Morrison
 
Scalable web-based workflow platform
Scalable web-based workflow platformScalable web-based workflow platform
Scalable web-based workflow platformAshutosh Bijoor
 
Events Workflow diagram
Events Workflow diagramEvents Workflow diagram
Events Workflow diagramColin Thomson
 
Event sourcing with reactor and spring statemachine
Event sourcing with reactor and spring statemachineEvent sourcing with reactor and spring statemachine
Event sourcing with reactor and spring statemachineJimmy Lu
 
Corporate Workflow Process - Complaints and Legal Matters (illustration)
Corporate Workflow Process - Complaints and Legal Matters (illustration)Corporate Workflow Process - Complaints and Legal Matters (illustration)
Corporate Workflow Process - Complaints and Legal Matters (illustration)Elizabeth Baker, JD, CRCMP
 
The Workflow Reference Model
The Workflow Reference ModelThe Workflow Reference Model
The Workflow Reference ModelAldo Quelopana
 
Djangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsDjangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsNowell Strite
 
OSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine LearningOSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine LearningPaco Nathan
 
Cognitive IBM Watson Services for Bluemix Developers
Cognitive IBM Watson Services for Bluemix DevelopersCognitive IBM Watson Services for Bluemix Developers
Cognitive IBM Watson Services for Bluemix DevelopersNiklas Heidloff
 

Destacado (17)

A simple workflow system using state machines
A simple workflow system using state machinesA simple workflow system using state machines
A simple workflow system using state machines
 
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
 
workflow in temporal state machine v1
workflow in temporal state machine v1workflow in temporal state machine v1
workflow in temporal state machine v1
 
Workflow Foundation 4
Workflow Foundation 4Workflow Foundation 4
Workflow Foundation 4
 
Scalable web-based workflow platform
Scalable web-based workflow platformScalable web-based workflow platform
Scalable web-based workflow platform
 
Windows Workflow Foundation
Windows Workflow FoundationWindows Workflow Foundation
Windows Workflow Foundation
 
Events Workflow diagram
Events Workflow diagramEvents Workflow diagram
Events Workflow diagram
 
Spring statemachine
Spring statemachineSpring statemachine
Spring statemachine
 
Workflow for XPages
Workflow for XPagesWorkflow for XPages
Workflow for XPages
 
Event sourcing with reactor and spring statemachine
Event sourcing with reactor and spring statemachineEvent sourcing with reactor and spring statemachine
Event sourcing with reactor and spring statemachine
 
Corporate Workflow Process - Complaints and Legal Matters (illustration)
Corporate Workflow Process - Complaints and Legal Matters (illustration)Corporate Workflow Process - Complaints and Legal Matters (illustration)
Corporate Workflow Process - Complaints and Legal Matters (illustration)
 
The Workflow Reference Model
The Workflow Reference ModelThe Workflow Reference Model
The Workflow Reference Model
 
Neuro4j Workflow Overview
Neuro4j Workflow OverviewNeuro4j Workflow Overview
Neuro4j Workflow Overview
 
Djangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsDjangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable Applications
 
OSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine LearningOSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine Learning
 
Cognitive IBM Watson Services for Bluemix Developers
Cognitive IBM Watson Services for Bluemix DevelopersCognitive IBM Watson Services for Bluemix Developers
Cognitive IBM Watson Services for Bluemix Developers
 
Java workflow engines
Java workflow enginesJava workflow engines
Java workflow engines
 

Similar a State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy presented by Mike Fitzmaurice

Unit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingUnit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingLeahRachael
 
TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101 TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101 TAG
 
Performance tuning Grails applications
Performance tuning Grails applicationsPerformance tuning Grails applications
Performance tuning Grails applicationsLari Hotari
 
Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2mohanaps
 
How to speed up your SAP PI/CPI development
How to speed up your SAP PI/CPI developmentHow to speed up your SAP PI/CPI development
How to speed up your SAP PI/CPI developmentDaniel Graversen
 
DMM9 - Data Migration Testing
DMM9 - Data Migration TestingDMM9 - Data Migration Testing
DMM9 - Data Migration TestingNick van Beest
 
Process Builder Automation and Considerations
Process Builder Automation and ConsiderationsProcess Builder Automation and Considerations
Process Builder Automation and ConsiderationsSathishkumar Periyasamy
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 
B.tech admission in india
B.tech admission in indiaB.tech admission in india
B.tech admission in indiaEdhole.com
 
Talkin bout Flow - Meighan Brodkey WIT Devs
Talkin bout Flow - Meighan Brodkey WIT Devs Talkin bout Flow - Meighan Brodkey WIT Devs
Talkin bout Flow - Meighan Brodkey WIT Devs Meighan Brodkey
 
Generating unit tests based on user logs
Generating unit tests based on user logsGenerating unit tests based on user logs
Generating unit tests based on user logsRick Wicker
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comAviran Mordo
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build testLen Bass
 
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...ssuser13124f
 
Alm with tfs 2013
Alm with tfs 2013Alm with tfs 2013
Alm with tfs 2013MSDEVMTL
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxPankaj Debbarma
 
Advanced Lean Training Manual Toolkit.ppt
Advanced Lean Training Manual Toolkit.pptAdvanced Lean Training Manual Toolkit.ppt
Advanced Lean Training Manual Toolkit.pptThinL389917
 
Making a Mock by Kelsey Shannahan
Making a Mock by Kelsey ShannahanMaking a Mock by Kelsey Shannahan
Making a Mock by Kelsey ShannahanQA or the Highway
 

Similar a State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy presented by Mike Fitzmaurice (20)

Unit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingUnit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programming
 
TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101 TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101
 
Performance tuning Grails applications
Performance tuning Grails applicationsPerformance tuning Grails applications
Performance tuning Grails applications
 
Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2
 
How to speed up your SAP PI/CPI development
How to speed up your SAP PI/CPI developmentHow to speed up your SAP PI/CPI development
How to speed up your SAP PI/CPI development
 
Telecom testing
Telecom testingTelecom testing
Telecom testing
 
Software Testing
Software Testing Software Testing
Software Testing
 
DMM9 - Data Migration Testing
DMM9 - Data Migration TestingDMM9 - Data Migration Testing
DMM9 - Data Migration Testing
 
Process Builder Automation and Considerations
Process Builder Automation and ConsiderationsProcess Builder Automation and Considerations
Process Builder Automation and Considerations
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
B.tech admission in india
B.tech admission in indiaB.tech admission in india
B.tech admission in india
 
Talkin bout Flow - Meighan Brodkey WIT Devs
Talkin bout Flow - Meighan Brodkey WIT Devs Talkin bout Flow - Meighan Brodkey WIT Devs
Talkin bout Flow - Meighan Brodkey WIT Devs
 
Generating unit tests based on user logs
Generating unit tests based on user logsGenerating unit tests based on user logs
Generating unit tests based on user logs
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build test
 
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...
ASUG82919 - Tips and Tricks for Every Workflow Developer or Administrator for...
 
Alm with tfs 2013
Alm with tfs 2013Alm with tfs 2013
Alm with tfs 2013
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptx
 
Advanced Lean Training Manual Toolkit.ppt
Advanced Lean Training Manual Toolkit.pptAdvanced Lean Training Manual Toolkit.ppt
Advanced Lean Training Manual Toolkit.ppt
 
Making a Mock by Kelsey Shannahan
Making a Mock by Kelsey ShannahanMaking a Mock by Kelsey Shannahan
Making a Mock by Kelsey Shannahan
 

Más de European SharePoint Conference

Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil Hodgkinson
Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil HodgkinsonConfiguring Hybrid Workloads for SharePoint 2013 and O365 by Neil Hodgkinson
Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil HodgkinsonEuropean SharePoint Conference
 
Using SharePoint 2013 Search in Content Publishing presented by Marwan Tarek
Using SharePoint 2013 Search in Content Publishing presented by Marwan TarekUsing SharePoint 2013 Search in Content Publishing presented by Marwan Tarek
Using SharePoint 2013 Search in Content Publishing presented by Marwan TarekEuropean SharePoint Conference
 
SharePoint: The Evolution of a Business Collaboration Platform presented by J...
SharePoint: The Evolution of a Business Collaboration Platform presented by J...SharePoint: The Evolution of a Business Collaboration Platform presented by J...
SharePoint: The Evolution of a Business Collaboration Platform presented by J...European SharePoint Conference
 
Tips and Tricks for the Yammer Power User presented by Christian Buckley
Tips and Tricks for the Yammer Power User presented by Christian BuckleyTips and Tricks for the Yammer Power User presented by Christian Buckley
Tips and Tricks for the Yammer Power User presented by Christian BuckleyEuropean SharePoint Conference
 
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...European SharePoint Conference
 
Create a blueprint of your Farm using PowerShell with Corey Burke
Create a blueprint of your Farm using PowerShell with Corey BurkeCreate a blueprint of your Farm using PowerShell with Corey Burke
Create a blueprint of your Farm using PowerShell with Corey BurkeEuropean SharePoint Conference
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...European SharePoint Conference
 
SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaSharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaEuropean SharePoint Conference
 
11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...European SharePoint Conference
 
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...European SharePoint Conference
 
SharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearySharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearyEuropean SharePoint Conference
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...European SharePoint Conference
 
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...European SharePoint Conference
 
Installing SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsInstalling SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsEuropean SharePoint Conference
 

Más de European SharePoint Conference (14)

Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil Hodgkinson
Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil HodgkinsonConfiguring Hybrid Workloads for SharePoint 2013 and O365 by Neil Hodgkinson
Configuring Hybrid Workloads for SharePoint 2013 and O365 by Neil Hodgkinson
 
Using SharePoint 2013 Search in Content Publishing presented by Marwan Tarek
Using SharePoint 2013 Search in Content Publishing presented by Marwan TarekUsing SharePoint 2013 Search in Content Publishing presented by Marwan Tarek
Using SharePoint 2013 Search in Content Publishing presented by Marwan Tarek
 
SharePoint: The Evolution of a Business Collaboration Platform presented by J...
SharePoint: The Evolution of a Business Collaboration Platform presented by J...SharePoint: The Evolution of a Business Collaboration Platform presented by J...
SharePoint: The Evolution of a Business Collaboration Platform presented by J...
 
Tips and Tricks for the Yammer Power User presented by Christian Buckley
Tips and Tricks for the Yammer Power User presented by Christian BuckleyTips and Tricks for the Yammer Power User presented by Christian Buckley
Tips and Tricks for the Yammer Power User presented by Christian Buckley
 
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...
Work Management Service – Using SharePoint 2013 as consolidated tasks platfor...
 
Create a blueprint of your Farm using PowerShell with Corey Burke
Create a blueprint of your Farm using PowerShell with Corey BurkeCreate a blueprint of your Farm using PowerShell with Corey Burke
Create a blueprint of your Farm using PowerShell with Corey Burke
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
 
SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaSharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
 
11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...
 
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
 
SharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearySharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam Cleary
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
 
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
 
Installing SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsInstalling SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan Richards
 

Último

FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 

Último (20)

FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 

State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy presented by Mike Fitzmaurice

  • 1. State Machine Workflows: Esoteric Techniques or Something Everyone Should Be Using?
  • 2. Setting Expectations • This session is about workflow design – I want to advocate a way of thinking – Plenty of resources exist for coding; this isn’t one of them • If you already understand state machines, and you already like them, this session might not be for you • I will indeed use Nintex Workflow for some demos – I know it well and can illustrate a concept quickly with it – But this is not a session pitching Nintex Workflow – Other products can do state machines, too
  • 3. Consider A Press Release • • • • Author Management Legal department Publisher
  • 4. You May Think Like This
  • 6. What About • Getting professional editorial help? • Other outcomes? – e.g., Legal wants to clarify a point with Management
  • 8. How About This? Authoring Manager Review Legal Review Publishin g (re)Submit? Choice Choice Deploy to Public SharePoint Site No End Yes Mgr Rev Request changes Auth Forward to Legal Mgr Apr Request changes Auth Request clarification Approve Pub Mgr Apr End
  • 9. Or Even This? Authoring Manager Review PR Polishing Legal Review Publishin g (re)Submit? Choice Choice Choice Deploy to Public SharePoint Site No End Yes Mgr Rev Request changes Auth Approve PR Draft Changes Approve Request changes Request clarification Auth Auth Approve Request clarification Leg Pub Mgr Apr PR End
  • 10. State Machines • States • Events • Transitions State Switched On Event Transition Button Click Transition Button Event Click Switched Off State
  • 11. • State Machines vs. Sequential Workflow Sequential Workflow – – – – – • Predictable Wait, then march forward Workflow is in control of the process Most decisions happen within the workflow Workflow’s job is to direct State machine workflow – – – – – Event driven No concept of “waiting”; workflow is in one state until it isn’t Actions are in control of the process Most decisions happen outside of the workflow Workflow’s job is to govern
  • 12. Bug Tracking Example How you think it works • Tester opens bug • Developer fixes bug • Tester approves fix
  • 13. Bug Tracking Example What really happens • A tester opens a bug, and assigns it to Bill. • Bill says, “no not me, this is Clive’s”, and reassigns the bug to him. • Or Bill says, “this tester is not in this case quite correct” (or words to that effect), and rejects the bug as nonsense. • Or Bill asks the tester for clarifying information. • Or even, if he’s in a good mood, Bill fixes it and hands it back to the tester. – Or, if the original tester is out, another tester. • Or the tester withdraws an erroneous bug (surely not) • And so on.
  • 14. Bug Tracking Example: Sequential Tester T creates instance of bug workflow T adds bug details T assigns to developer D LabelB: Switch D assigns to developer E: Goto LabelB D rejects bug to T: Switch T accepts rejection: Exit T updates bug and assigns to developer F: Goto LabelB End Switch D requests info from T: T submits info Goto LabelB D submits solution to T: GoTo LabelB T withdraws bug: Exit End Switch
  • 15. Bug Tracking Example: State Machine • • • • • • State: Initial – Action: T adds bug details – Action: T assigns to developer D; new state = Fixing State: Fixing – Action: D assigns to developer E – Action: D rejects bug to T; new state = Rejected – Action: D requests info; new state = Pending Info – Action: D submits solution; new state = Pending Approval – Action: T withdraws bug; new state = Closed State: Rejected – Action: T accepts rejection; new state = Closed – Action: T updates bug and assigns to developer F; new state = Fixing State: Pending Info – Action: T submits info; new state = Fixing State: Pending Approval – Action: T rejects solution; new state = Fixing – Action: T accepts solution; new state = Closed State: Closed
  • 16. Even “Obvious” Sequential Processes Can Be Secret State Machines • Expense approval – Usually, if any problem, reject and restart • No way to track how long it takes to get an eventual outcome – Model back-and-forth into the workflow • Escalation • Return for clarification • Leave approval – Allows negotiation to be factored in to the process
  • 17. When Do You Use a State Machine? • When you need – Flexibility • You can add new states with minimal impact • You can modify steps within a state without fear of wide impact – Visibility • The more complex, the harder sequential workflows are to read • Harder to visualize graphically, but very easy to read a log – Control • Counterintuitive • You can easily define how to skip steps • You can more easily manually induce a revert-to-state, skip-to-state • Actually, almost always
  • 18. Why State Machines are Useful • We want workflows to follow a predictable path – We find that real-world demands get in the way • Without state machines, you’ll wind up with: – – – – A lot of If-Then-Else conditions A lot of looping Lots and lots of arrows to the point of “Spaghetti” Graphical “goto” statements • Most workflows actually wait for people to do something – That’s a “decision outside of the workflow” scenario • The current state is useful for status reporting
  • 19. Sequential Activity Inside a State • Inside of a state, sequential actions take place – – – – – Evaluate conditions Transform data Process transitions Branch based on conditions Assign tasks • Technically, some of these a mini-state changes • You can nest state machines inside of states
  • 20. Sequential Flow Using State Machines • Define the rules correctly • State machine workflow will follow a predictable path • Until you need it not to 
  • 21. Can Users Understand This? • Don’t call it a “state machine” • Call them “stages” instead of “states” • Call it “moving back and forth” rather than “transitions” • Users love being able to handle exceptions • Users love being able to change rules
  • 22. Using State Machines for Exception Handling • Add “Error Encountered” state • Have workflow actions change state upon exception • Have “Error Encountered” state: – Undo earlier work – Create compensating actions if necessary – Report error to process owner
  • 23. Using State Machines to Restart a Workflow Where It Last Left Off • Add a field to a list item; leave it out of most views – “Internal Workflow State” • Workflow begins in “Evaulate Initial State” state – Checks InternalWorkflowState variable – Transitions to correct state accordingly
  • 24. Can You Loop? You Can Simulate a State Machine • You will need: – Variable – Loop – Switch • Steps: – Set variable to initial state immediately before loop – Put a switch inside a loop • Switch evaluates variable and branches accordingly – When you need to change state, change the value of that variable and wait for looping to occur – Make sure at least one of the states causes the loop to end
  • 25. You Can Even Do This In SharePoint Designer (Sort of) • Warning – this is for entertainment purposes only • One field to store current state • One startup workflow, plus one workflow for each state – Last step of each workflow sets a field value – All state workflows started by modification to item (except for the workflow that caused the change to take place, of course) – Each workflow first checks state field, exits if not target state • This isn’t practical, though – It effectively starts all state workflows (other than the current one) with every change – Plays havoc with the audit trail
  • 26. Windows Workflow Foundation 4.0 • Microsoft removed state machines from WF 4.0 • Introduced a Flowchart workflow type instead – Still consisted of states – Graphical paths between states – Worked for many use cases • Backlash ensued! • Microsoft later introduced a State Machine activity – Posted to CodePlex – http://wf.codeplex.com/releases/view/43586
  • 27. Conclusion • State machines sound esoteric – they’re not • State machines have genuine practical benefits • This is a way of designing, not coding – State machines can behave sequentially if need be – Sequential workflows can behave like state machines if need be • Many products can do this • A lot of content exists to help