SlideShare a Scribd company logo
Introducing
Spring Web Flow
Emad Omara
1
May 30, 2016
Agenda
• Why do we need SWF ?
• What is SWF ?
• How it works ?
• Demo
2
The Navigation problem !
 response.sendRedirect(“page.jsp");
 Spring MVC :
@RequestMapping("/operation")
public String processOperationPage() { return “/corpus/operation"; }
- Struts
<action-mappings> …. <forward name="name" path="/name.jsp"/> </ action-mappings>
- JSF
<navigation-rule><navigation-case>
<from-outcome>page2</from-outcome>
<to-view-id>/page2.xhtml</to-view-id>
</navigation-case> </navigation-rule> 3
Disadvantages
 Visualizing the flow is very difficult
 Mixed navigation and view
 Overall navigation rules complexity
 Lack of state control/navigation customization
4
What is Spring Web Flow?
 Spring MVC extension
 Introduces flows concept
 Extends application scopes
 Web flows are designed to be self contained, and thus
are reusable multiple of times
 UML Like diagram 
5
Important Classes
 FlowDefinition - This class stores the definition of the flow. It contains the set of states that form
part of the flow. Each flow has one start state.
 FlowRegistry - This class contains all the flow definitions.
 FlowHandlerMapping - This is a HandlerMapping that creates a URL from the ids registered in the
flow registry. It returns a FlowHandler if a matching id is found in the flow registry.
 FlowHandler - This is a controller helper that has the reference to the actual flow. It handles the
execution of the flow, its outcomes and exceptions.
 FlowHandlerAdapter - This is the HandlerAdapter for web flows. It delegates work to the mapped
FlowHandler.
 FlowExecutor - This is the central class of the Flow and is the facade for the actual flow. It manages
creating of new flows or resuming existing flows. It is an entry into the Spring web flow system.
6
Request Diagram
System Setup
 Web Flow schema :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd">
<!-- Setup Web Flow here -->
</beans>
8
System Setup 2 (Flow Registry)
URL : /WEB-INF/flows/hotels/booking/booking-flow.xml
9
Flow ID=/hotels/booking
Flow ID=springpizza
Flow ID=pizza
System Setup 3
10
Flow
 A flow defines a dialogue, between users and server that meets business goal
11
Flow Essential elements
 State
 Transition
 Flow data
 Expression language
12
Flow States
 View States : A view state displays information to a user or obtains user input using a
form. (e.g. JSP)
 Action States : Action states are where actions are perfomed by the spring beans. The
action state transitions to another state. The action states generally have an evaluate
property that describes what needs to be done.
 Decision States: A decision state has two transitions depending on whether the
decision evaluates to true or false.
 Subflow States :It may be advantageous to call another flow from one flow to
complete some steps. Passing inputs and expecting outputs.
 End States : The end state signifies the end of flow. If the end state is part of a root flow
then the execution is ended. However, if its part of a sub flow then the root flow is resumed.
13
Flow Data Scopes
 Flow Data can be stored as variables that can be created using the 'var' element.
 Variable scope - The lifespan of the variable depends on the scope with which it is declared. The
scopes available are:
 Request - Available during the life of a request in a flow
 Flash -Extended request scope for PRG case , Useful for rendering error/warning messages
 View - Available only during the lifetime of a view. Created when a view is created and destroyed once a
view is destroyed
 Flow - Available within a flow. Not available in sub flows
 Conversation - The conversation scope starts when a flow starts and ends when the flow ends. It is available
in sub flows
14
Flow elements
15
View State
16
Decision State
17
Action State
18
Sub Flow State
19
Input attributes
20
Output Value
21
Firing Events
22
Events
23
References
 Web Flow reference
 http://static.springframework.org/spring-webflow/docs/2.3.x/reference/html/index.html
 samples
 https://github.com/spring-projects/spring-webflow-samples
 Spring Web Flow 2 Web Development
 https://www.safaribooksonline.com/library/view/spring-web-flow/9781847195425/pr01.html
 Refcardz
 http://refcardz.dzone.com/refcardz/spring-web-flow
24
Demo
25
Thank you
Emad
26

More Related Content

What's hot

Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WSKatrien Verbert
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
Andy Schwartz
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
Carol McDonald
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties component
prudhvivreddy
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
Peter R. Egli
 
Java web application development
Java web application developmentJava web application development
Java web application development
RitikRathaur
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
BG Java EE Course
 
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Fahad Golra
 
SpringMVC
SpringMVCSpringMVC
SpringMVC
Aircon Chen
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
Carol McDonald
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
AnusAhmad
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web Services
Emprovise
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)
Fahad Golra
 
Jax ws
Jax wsJax ws
Jax ws
F K
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 

What's hot (20)

Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WS
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RS
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties component
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
Java web application development
Java web application developmentJava web application development
Java web application development
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
 
SpringMVC
SpringMVCSpringMVC
SpringMVC
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web Services
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)
 
Jax ws
Jax wsJax ws
Jax ws
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 

Viewers also liked

Formation Google App Engine
Formation Google App EngineFormation Google App Engine
Formation Google App Engine
Abdelhakim Rhanizar
 
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Kamil Kedzierski
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014Ibrahim Hejab
 
FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)
rinnocente
 
fpga programming
fpga programmingfpga programming
fpga programmingAnish Gupta
 
Xilinx lca and altera flex
Xilinx lca and altera flexXilinx lca and altera flex
Xilinx lca and altera flexanishgoel
 
Fpga
FpgaFpga

Viewers also liked (7)

Formation Google App Engine
Formation Google App EngineFormation Google App Engine
Formation Google App Engine
 
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014
 
FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)
 
fpga programming
fpga programmingfpga programming
fpga programming
 
Xilinx lca and altera flex
Xilinx lca and altera flexXilinx lca and altera flex
Xilinx lca and altera flex
 
Fpga
FpgaFpga
Fpga
 

Similar to Introduction to Srping Web Flow

Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
Majurageerthan Arumugathasan
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
John Lewis
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
prudhvivreddy
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
John Lewis
 
Spring Web Flow
Spring Web FlowSpring Web Flow
Spring Web Flow
NexThoughts Technologies
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
6 10-presentation
6 10-presentation6 10-presentation
6 10-presentation
Remi Arnaud
 
Struts Action
Struts ActionStruts Action
Struts Action
Vijay subedar
 
Spring Web Flow Grail's Plugin
Spring Web Flow Grail's PluginSpring Web Flow Grail's Plugin
Spring Web Flow Grail's Plugin
C-DAC
 
WS-VLAM workflow
WS-VLAM workflowWS-VLAM workflow
WS-VLAM workflowguest6295d0
 
Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui framework
HongSeong Jeon
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
Rudra Garnaik, PMI-ACP®
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
Inexture Solutions
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Arun Gupta
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
Nicola Pedot
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
How to use soap component
How to use soap componentHow to use soap component
How to use soap component
RaviRajuRamaKrishna
 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetry
pphaal
 

Similar to Introduction to Srping Web Flow (20)

Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Spring Web Flow
Spring Web FlowSpring Web Flow
Spring Web Flow
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics Revised
 
6 10-presentation
6 10-presentation6 10-presentation
6 10-presentation
 
Struts Action
Struts ActionStruts Action
Struts Action
 
Spring Web Flow Grail's Plugin
Spring Web Flow Grail's PluginSpring Web Flow Grail's Plugin
Spring Web Flow Grail's Plugin
 
WS-VLAM workflow
WS-VLAM workflowWS-VLAM workflow
WS-VLAM workflow
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui framework
 
Splitter
SplitterSplitter
Splitter
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
How to use soap component
How to use soap componentHow to use soap component
How to use soap component
 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetry
 

Recently uploaded

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 

Recently uploaded (20)

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 

Introduction to Srping Web Flow

  • 1. Introducing Spring Web Flow Emad Omara 1 May 30, 2016
  • 2. Agenda • Why do we need SWF ? • What is SWF ? • How it works ? • Demo 2
  • 3. The Navigation problem !  response.sendRedirect(“page.jsp");  Spring MVC : @RequestMapping("/operation") public String processOperationPage() { return “/corpus/operation"; } - Struts <action-mappings> …. <forward name="name" path="/name.jsp"/> </ action-mappings> - JSF <navigation-rule><navigation-case> <from-outcome>page2</from-outcome> <to-view-id>/page2.xhtml</to-view-id> </navigation-case> </navigation-rule> 3
  • 4. Disadvantages  Visualizing the flow is very difficult  Mixed navigation and view  Overall navigation rules complexity  Lack of state control/navigation customization 4
  • 5. What is Spring Web Flow?  Spring MVC extension  Introduces flows concept  Extends application scopes  Web flows are designed to be self contained, and thus are reusable multiple of times  UML Like diagram  5
  • 6. Important Classes  FlowDefinition - This class stores the definition of the flow. It contains the set of states that form part of the flow. Each flow has one start state.  FlowRegistry - This class contains all the flow definitions.  FlowHandlerMapping - This is a HandlerMapping that creates a URL from the ids registered in the flow registry. It returns a FlowHandler if a matching id is found in the flow registry.  FlowHandler - This is a controller helper that has the reference to the actual flow. It handles the execution of the flow, its outcomes and exceptions.  FlowHandlerAdapter - This is the HandlerAdapter for web flows. It delegates work to the mapped FlowHandler.  FlowExecutor - This is the central class of the Flow and is the facade for the actual flow. It manages creating of new flows or resuming existing flows. It is an entry into the Spring web flow system. 6
  • 8. System Setup  Web Flow schema : <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd"> <!-- Setup Web Flow here --> </beans> 8
  • 9. System Setup 2 (Flow Registry) URL : /WEB-INF/flows/hotels/booking/booking-flow.xml 9 Flow ID=/hotels/booking Flow ID=springpizza Flow ID=pizza
  • 11. Flow  A flow defines a dialogue, between users and server that meets business goal 11
  • 12. Flow Essential elements  State  Transition  Flow data  Expression language 12
  • 13. Flow States  View States : A view state displays information to a user or obtains user input using a form. (e.g. JSP)  Action States : Action states are where actions are perfomed by the spring beans. The action state transitions to another state. The action states generally have an evaluate property that describes what needs to be done.  Decision States: A decision state has two transitions depending on whether the decision evaluates to true or false.  Subflow States :It may be advantageous to call another flow from one flow to complete some steps. Passing inputs and expecting outputs.  End States : The end state signifies the end of flow. If the end state is part of a root flow then the execution is ended. However, if its part of a sub flow then the root flow is resumed. 13
  • 14. Flow Data Scopes  Flow Data can be stored as variables that can be created using the 'var' element.  Variable scope - The lifespan of the variable depends on the scope with which it is declared. The scopes available are:  Request - Available during the life of a request in a flow  Flash -Extended request scope for PRG case , Useful for rendering error/warning messages  View - Available only during the lifetime of a view. Created when a view is created and destroyed once a view is destroyed  Flow - Available within a flow. Not available in sub flows  Conversation - The conversation scope starts when a flow starts and ends when the flow ends. It is available in sub flows 14
  • 24. References  Web Flow reference  http://static.springframework.org/spring-webflow/docs/2.3.x/reference/html/index.html  samples  https://github.com/spring-projects/spring-webflow-samples  Spring Web Flow 2 Web Development  https://www.safaribooksonline.com/library/view/spring-web-flow/9781847195425/pr01.html  Refcardz  http://refcardz.dzone.com/refcardz/spring-web-flow 24

Editor's Notes

  1. Method Signature ()  Which is empty without arguments because our method in this case (run) does not accept arguments, but in case we implement method that accept arguments we would give here arguments names without types because of course the interface as we said has only one method and they types are already known and lambda target is to eliminate the unnecessary syntax .   The second part is the implementation of the method body