SlideShare a Scribd company logo
1 of 25
Download to read offline
Introduction to the Flow Factory
Design Pattern
Developers Track
Adam Purkiss, MondayCall Solutions, Principal Architect
@apurkiss
adampurkiss.com
Learning the hard way…

ENTER COMMAND: GO NORTH

■
Learning the hard way…

ENTER COMMAND:

■
Object-oriented design patterns
▪ Program to an interface, not an implementation
▪

Strive for loosely-coupled designs

▪

Encapsulate what varies

▪

Remember the open-closed principle
Object-oriented design patterns
Requirements gathering
The problem
Course
Complete
In international
registry?

In US registry?

Update
Salesforce

N
Create
profile

Y
Update
profile

N

Y

Update profile

Done
Welcome
email
The problem grew
Course
Complete
In rewards
program?

In US registry?

Update
Salesforce

N
Create
profile

Y
Update
profile

Y
Add rewards
points

N

In international
registry?

N

Y

Update profile

Done
Welcome
email

Rewards
email
Callout constraints
Deferring DML and email
Course
Complete
In rewards
program?

In US registry?

Update
Salesforce

N
Create
profile

Y
Update
profile

Y
Add rewards
points

N

In international
registry?

N

Y

Update profile

Done
Welcome
email

Rewards
email
The Flow Factory
▪ Flow-specific inputs
▪ Executed steps collection
▪ Steps create & return next steps
▪

Inversion of Control

▪ Two pass execution
▪

Pass 1: Step.processStep()

▪

Pass 2: Step.finish()
Flow of the flow
Pass 1
Step 1

Step 2

Step 3

Step 4

▪Add self to list
▪Process work
▪Create next

▪…
▪…
▪…

▪…
▪...
▪…

▪...
▪…
▪Return null

Step 1

Step 2

Step 3

Step 4

▪Final processing

▪…

▪…

▪…

Pass 2 (DML)
Flow of the flow
Pass 1
Step 1

Step 2

Step 3

Step 4

processStep()

processStep()

processStep()

processStep()

Step 1

Step 2

Step 3

Step 4

finish()

finish()

finish()

finish()

Pass 2 (DML)
Logical interfaces
▪ FlowStep (create / process / finish)
▪ FlowState (inputs / aggregate)
▪ FlowParent (process loop / finish loop)
FlowStep
1) Next step / step name
2) Process step / finish
3) Create instance
1
2
3
FlowStep variation
▪ Create dynamic instance
FlowState
1) Steps aggregate in parent list
2) Flow-specific inputs in subclass
1

2
FlowParent
1) Provide initial step & state
2) Main loop (pass 1)
3) Finish loop (pass 2)
1
2

3
Invoking a flow example
1) Subclass FlowParent / processWork()
2) Invoke flow
1

2
Pass 1
processStep()
Course
Nothing
Complete

Update
Salesforce

In rewards
program?
processStep()
Callout

In US registry?

processStep()
Callout

N
Create
profile

Y
Update
profile

Y
Add rewards
points

N

In international
registry?
processStep()

N

Callout

Y

Update profile

Done
Welcome
email

Rewards
email
Pass 2
finish()
Course
Update Salesforce
(DML)Complete
In US registry?

Update
Salesforce

Save callout response
Send email

N

In international
registry?
finish()

N

Save callout response

N

finish()

In rewards
program?

Create
profile

Y
Update
profile

Y
Add rewards
finish() points
Save callout response
Send email

Y

Update profile

Done
Welcome
email

Rewards
email
Demo
Resources
GitHub:
▪https://github.com/apurkiss/course-complete

Developerforce Wiki:
▪http://wiki.developerforce.com/page/The_Flow_Factory_Design_Pattern

Pluralsight: Force.com Design Patterns - Part 2
▪http://pluralsight.com/training/Courses/TableOfContents/forcedotcom-designpatterns-part2
Adam Purkiss
Principal Architect,
@apurkiss
Introduction to The Flow Factory Design Pattern

More Related Content

What's hot

What's hot (20)

Laravel overview
Laravel overviewLaravel overview
Laravel overview
 
Spring: Overview do framework mais popular para desenvolvimento em Java
Spring: Overview do framework mais popular para desenvolvimento em JavaSpring: Overview do framework mais popular para desenvolvimento em Java
Spring: Overview do framework mais popular para desenvolvimento em Java
 
Meet up teste api htt-party cucumber
Meet up   teste api htt-party cucumberMeet up   teste api htt-party cucumber
Meet up teste api htt-party cucumber
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Evolution / History of ASP.NET
Evolution / History of ASP.NETEvolution / History of ASP.NET
Evolution / History of ASP.NET
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Java OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCJava OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBC
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive FormsAngular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive Forms
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 
Intellij idea tutorial
Intellij idea tutorialIntellij idea tutorial
Intellij idea tutorial
 
Spring Ldap
Spring LdapSpring Ldap
Spring Ldap
 
laravel.pptx
laravel.pptxlaravel.pptx
laravel.pptx
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Angular Conceptos Practicos 1
Angular Conceptos Practicos 1Angular Conceptos Practicos 1
Angular Conceptos Practicos 1
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 

Viewers also liked

Facility location and layout planning
Facility location and layout planningFacility location and layout planning
Facility location and layout planning
Birodh Adhikari
 
Facilities layout design and facilities location
Facilities layout design and facilities locationFacilities layout design and facilities location
Facilities layout design and facilities location
Kinjal Lakhani
 
Blackboard Pattern
Blackboard PatternBlackboard Pattern
Blackboard Pattern
tcab22
 
Facility location and techniques
Facility location and techniquesFacility location and techniques
Facility location and techniques
Piyush Sharma
 

Viewers also liked (17)

Facility location
Facility locationFacility location
Facility location
 
Facility location and layout planning
Facility location and layout planningFacility location and layout planning
Facility location and layout planning
 
Flow Factory Oy / Peliteknologialla muistin aktivointia
Flow Factory Oy / Peliteknologialla muistin aktivointiaFlow Factory Oy / Peliteknologialla muistin aktivointia
Flow Factory Oy / Peliteknologialla muistin aktivointia
 
Successful Factory Design Implementation
Successful Factory Design ImplementationSuccessful Factory Design Implementation
Successful Factory Design Implementation
 
Location
LocationLocation
Location
 
Facilities layout design and facilities location
Facilities layout design and facilities locationFacilities layout design and facilities location
Facilities layout design and facilities location
 
Factory design suite
Factory design suiteFactory design suite
Factory design suite
 
Location ppt
Location pptLocation ppt
Location ppt
 
Blackboard Pattern
Blackboard PatternBlackboard Pattern
Blackboard Pattern
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)
 
Characteristic Comparison of U-Shaped Monopole and Complete Monopole Antenna
Characteristic Comparison of U-Shaped Monopole and Complete Monopole AntennaCharacteristic Comparison of U-Shaped Monopole and Complete Monopole Antenna
Characteristic Comparison of U-Shaped Monopole and Complete Monopole Antenna
 
Facility Layout
Facility LayoutFacility Layout
Facility Layout
 
Facility Layout in production management
Facility Layout in production managementFacility Layout in production management
Facility Layout in production management
 
Facility layout ppt
Facility layout pptFacility layout ppt
Facility layout ppt
 
Interior Design ppt.
Interior Design ppt.Interior Design ppt.
Interior Design ppt.
 
Principles of Interior Design
Principles of Interior DesignPrinciples of Interior Design
Principles of Interior Design
 
Facility location and techniques
Facility location and techniquesFacility location and techniques
Facility location and techniques
 

Similar to Introduction to The Flow Factory Design Pattern

Similar to Introduction to The Flow Factory Design Pattern (20)

APIdays Paris 2019 - API SDK Development - Lessons Learned by Jaap Brasser, ...
APIdays Paris 2019  - API SDK Development - Lessons Learned by Jaap Brasser, ...APIdays Paris 2019  - API SDK Development - Lessons Learned by Jaap Brasser, ...
APIdays Paris 2019 - API SDK Development - Lessons Learned by Jaap Brasser, ...
 
API SDK Development – Lessons Learned
API SDK Development – Lessons LearnedAPI SDK Development – Lessons Learned
API SDK Development – Lessons Learned
 
Leading the Transformation
Leading the TransformationLeading the Transformation
Leading the Transformation
 
What the heck is Kanban? - CodeMash 2014
What the heck is Kanban? - CodeMash 2014What the heck is Kanban? - CodeMash 2014
What the heck is Kanban? - CodeMash 2014
 
PeopleSoft-Environment-Cloning-Automation.pdf
PeopleSoft-Environment-Cloning-Automation.pdfPeopleSoft-Environment-Cloning-Automation.pdf
PeopleSoft-Environment-Cloning-Automation.pdf
 
Custom web n logo designs Company profile.pdf
Custom web n logo designs Company profile.pdfCustom web n logo designs Company profile.pdf
Custom web n logo designs Company profile.pdf
 
From Design to Delivery
From Design to DeliveryFrom Design to Delivery
From Design to Delivery
 
Visual Studio 2010 Agile Tools (overview)
Visual Studio 2010 Agile Tools (overview)Visual Studio 2010 Agile Tools (overview)
Visual Studio 2010 Agile Tools (overview)
 
Online Store Design Service Proposal PowerPoint Presentation Slides
Online Store Design Service Proposal PowerPoint Presentation SlidesOnline Store Design Service Proposal PowerPoint Presentation Slides
Online Store Design Service Proposal PowerPoint Presentation Slides
 
How to Manage a Mixed Portfolio of Products by Salesforce PM
How to Manage a Mixed Portfolio of Products by Salesforce PMHow to Manage a Mixed Portfolio of Products by Salesforce PM
How to Manage a Mixed Portfolio of Products by Salesforce PM
 
Littelfuse presentation research and performance showcase
Littelfuse presentation research and performance showcase Littelfuse presentation research and performance showcase
Littelfuse presentation research and performance showcase
 
Starting Your First Job in the Software Industry: Tips and Tricks from Nakov
Starting Your First Job in the Software Industry: Tips and Tricks from NakovStarting Your First Job in the Software Industry: Tips and Tricks from Nakov
Starting Your First Job in the Software Industry: Tips and Tricks from Nakov
 
Focused integration development with agile methodologies - Oracle Primavera P...
Focused integration development with agile methodologies - Oracle Primavera P...Focused integration development with agile methodologies - Oracle Primavera P...
Focused integration development with agile methodologies - Oracle Primavera P...
 
Shyama Sasidharan_CV
Shyama Sasidharan_CVShyama Sasidharan_CV
Shyama Sasidharan_CV
 
Professional portfolio 2 3_20
Professional portfolio 2 3_20Professional portfolio 2 3_20
Professional portfolio 2 3_20
 
Capstone pres
Capstone presCapstone pres
Capstone pres
 
Ecommerce Website Design Proposal PowerPoint Presentation Slides
Ecommerce Website Design Proposal PowerPoint Presentation SlidesEcommerce Website Design Proposal PowerPoint Presentation Slides
Ecommerce Website Design Proposal PowerPoint Presentation Slides
 
Office 365 development overview Nilesh Shah 15 march 2018
Office 365 development overview Nilesh Shah 15 march 2018Office 365 development overview Nilesh Shah 15 march 2018
Office 365 development overview Nilesh Shah 15 march 2018
 
Salesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification PathsSalesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification Paths
 
BoS2015 Jeff Szczepanski – COO, Stack Exchange - Stack Overflow. Scaling a Te...
BoS2015 Jeff Szczepanski – COO, Stack Exchange - Stack Overflow. Scaling a Te...BoS2015 Jeff Szczepanski – COO, Stack Exchange - Stack Overflow. Scaling a Te...
BoS2015 Jeff Szczepanski – COO, Stack Exchange - Stack Overflow. Scaling a Te...
 

More from Salesforce Developers

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Introduction to The Flow Factory Design Pattern