SlideShare une entreprise Scribd logo
1  sur  50
Business Process Management
          with REST
                Cesare Pautasso
             Faculty of Informatics
        University of Lugano, Switzerland

              c.pautasso@ieee.org
           http://www.pautasso.info
                   @pautasso
BPM       REST

©2010 - Cesare Pautasso          2
Business
                            RESTful
           Process
                          Web Services
          Management



©2010 - Cesare Pautasso                  3
WS-* Standards Stack




©2009-2010 - Cesare Pautasso - 30.6.2010   4
WS-* Standards Stack

                                   BPM                              Management
    Interoperability




                                                                      Transactions
                                                         Security
                                           Reliability
                       Metadata




                                                                                     State
                                                         Messaging

©2009-2010 - Cesare Pautasso - 30.6.2010                                                     5
BPM                       Management
    Interoperability




                                                              Transactions
                                                 Security
                                   Reliability
                       Metadata




                                                                             State
                                     Messaging
                                   Can you do     it
                                        with REST?
©2010 - Cesare Pautasso                                                              6
From REST-* (JBoss)



        “    We believe there is huge potential to




                                                        http://www.jboss.org/reststar/specifications/workflow.html
          marrying REST with workflow and BPM.
                              […]
          Combined with the architecture of the Web,
          a workflow service can provide both a truly
          simple, portable, and flexible way to build
          workflow driven integrations and


                          ”
          applications.




©2010 - Cesare Pautasso                                             7
Business Process Management
             BPMN/WS-BPEL
                                                           Workflow        Workflow
                           Process Model                   Users/Clients   Participants
                          Act 2      Act 4

         Act 1                       Act 5       Act 7

                          Act 3      Act 6

                                                    Workflow Management Engine
                   Workflow
                   Modelers
                                    Adapters                                        Bus

                                  Applications                                   Web
                                                                                 Services

                                           Databases


©2010 - Cesare Pautasso                                                                     8
WS-BPEL Primitives

                              Web      <receive>
            <invoke>
                             Service    <reply>


            <invoke>          Web
                                       <receive>
                             Service

      The modeling language natively supports
       the RPC or message-based connectors

©2010 - Cesare Pautasso                            9
What is your SOA connector today?

                          RPC           ESB



                                REST/HTTP



©2010 - Cesare Pautasso                       10
REST as a new connector

                          RPC                 ESB
                                         Publish/Subscribe
                          Call


                                 REST/HTTP

                             Get/Put/Post/Delete


©2010 - Cesare Pautasso                                      11
Is REST really used?
                                                      Atom, 2%
                                                       Gdata, 1%
                                       XMPP, 0%
                                                           JavaScript, 6%
                                     XML-RPC, 2%
                          SOAP, 17%                         JSON-RPC, 0%


                                SMS,                                        2042 APIs
                                 0%
                           RSS, 1%
                                                                   ProgrammableWeb.com
                                                                            30.6.2010
                                                   REST,
                                                   71%

©2010 - Cesare Pautasso                                                                 12
REST in one slide
  Web Services expose their
   data and functionality trough      PUT
   resources identified by URI
                                            R
  Uniform Interface Principle:        GET
   Clients interact with resources       POST
   through a fix set of verbs.                   DELETE
   Example HTTP:
   GET (read), PUT (update), DELETE, POST (catch all),
  Multiple representations for the same resource
  Hyperlinks model resource relationships and valid
   state transitions for dynamic protocol description
   and discovery
©2010 - Cesare Pautasso                                   13
Business Process Management
                                                            Workflow        Workflow
                           Process Model                    Users/Clients   Participants
                          Act 2      Act 4

         Act 1                       Act 5        Act 7

                          Act 3      Act 6

                                             RESTful Workflow Management Engine

 PUT


   GET
                 R                  Adapters                                         Bus

                                  Applications                                    Web
                                                                                  Services
        POST
                            DELETE         Databases


©2010 - Cesare Pautasso                                                                      14
BPM with REST

                           Process Model
                                                                      Publishing
                          Act 2    Act 4                          R   Processes
         Act 1                     Act 5        Act 7
                                                                      as Resources
                          Act 3    Act 6

                                           RESTful Workflow Management Engine




                                                                   RESTful
                                                                   Service
                                  R             R           R      Composition

©2010 - Cesare Pautasso                                                          15
BPM with REST
                                                         Publishing
            This talk will                           R   Processes
             focus here                                  as Resources

                              RESTful Workflow Management Engine




                                                      RESTful
                                                      Service
                          R        R           R      Composition

©2010 - Cesare Pautasso                                             16
Some Challenges for BPM engines
   Can you drive the execution of tasks with
    PUT/POST/DELETE requests?
   Can you monitor your processes with an
    RSS/ATOM feed?
   Can you bookmark a process instance?
   Can you send an email to your colleague with a
    link to a task from your worklist?
   Can you ask a process to give you links to its
    tasks left to be done?
   Can you publish your process as a resource?
   Can you publish resources from your process?
   Can you call RESTful APIs directly?
©2010 - Cesare Pautasso                              17
BPM         REST
    Processes             Resources/URIs
    Tasks                 Uniform
    Control Flow           Interface
    Data Flow             Representations
   …                      Hypermedia

©2010 - Cesare Pautasso                       18
Everything is a resource
                   /process/X       /process/X/1

                                      Process
                          Process
                                     Instance



                                       Task
                           Task
                                     Instance
                     /task/Y
                                    /task/Y/1


©2010 - Cesare Pautasso                            19
Hypermedia
                          /process                               Process
                                                      Process
                                                                Instance
         GET
                          /process/name                           Task
                                                       Task
                                                                Instance
          GET
                          /process/name/instance

          GET
                          /process/name/instance/taskname


             Follow links to discover the processes
                     deployed as resources
©2010 - Cesare Pautasso                                                    20
Representations
    Web page
with form to start                                                     List of process
 a new process                                                       input parameters
    instance       ContentType:                       ContentType:

                           text/html application/xml
                                    GET /process/name
                     ContentType:                              ContentType:
                 text/plain                             application/json
                                       ContentType:
   Basic textual                                                         Process
    description                     image/svg+xml                        metadata
  of the process                                                          in JSON

©2010 - Cesare Pautasso                                                              21
Uniform Interface and Hypermedia
                                      List the
               GET /process          deployed            Get a form
                                     processes         describing how
                GET /process/name                        to start the
                                                           process
                                             Start a new
                POST /process/name             process
                                              instance Check what
                                                          is the state
                GET /process/name/instance                    of the
                                                            instance
                 DELETE /process/name/instance
                                                         Clean up
                                                      (once it is done)
©2010 - Cesare Pautasso                                                   22
Starting or Running a new process?
                                /process    Should the client be kept
                                             waiting for the process to run
                                             until completion?
               POST /process




                            200 OK          Clients may want to block until
                          (Process           the whole process has
                          Finished           completed its execution
                            Reply)           (or it decides to reply to them)
©2010 - Cesare Pautasso                                                       23
Starting or Running a new process?
                              /process    The client starting a long
                                           running process is redirected to
                                           a location x representing the
               POST /process               newly started process instance
                                          The process and the client run
              202 Accepted                 asynchronously
              Location: x
                                          The client may retrieve the
                                           current state of the process
            GET /process/x                 instance at any time

                          200 OK




©2010 - Cesare Pautasso                                                  24
Uniform Interface and Hypermedia
               GET /task            List the
                                  active tasks          Get a form
                                                      describing how
                GET /task/name/instance               to perform the
                                                           task
                                                  Finish
                POST /task/name/instance
                                                 the task


                GET /task/name/instance               Get the final
                                                    representation
                                                   of the completed
                 …                                        task

©2010 - Cesare Pautasso                                                25
POST or PUT?
               GET /task                          Note:
                                           PUT could also be
                                               used here
                GET /task/name/instance     to set the state
                                           (Finished, Failed)
                                               of the task
                POST /task/name/instance


                GET /task/name/instance


                 …

©2010 - Cesare Pautasso                                         26
Example: RESTBucks




Jim Webber, Savas Parastatidis, Ian Robinson   http://restinpractice.com/ 27
Simple RESTBucks Example

                                            POST
  /rest/restbucks/order/1.0/
  /rest/restbucks/order/1.0/{id}
                 GET
   /tasks/restbucks/order/1.0/{id}/payment

                                    POST
                   GET



                          /receipt/{uuid}


©2010 - Cesare Pautasso                            28
Simple RESTBucks Example
  Hypermedia-centric service design (and implementation)
  done with a business process model




                                                           Private Tasks
   Resources




©2010 - Cesare Pautasso                                                29
Instantiating a process
    GET /rest/restbucks/order/1.0/




 Retrieve a form which describes how to instantiate a new process
©2010 - Cesare Pautasso                                             30
Instantiating a process
    POST /rest/restbucks/order/1.0/




                            Run = blocking
                            (client waits until
     Start = non blocking   the process replies)
     (redirect to URI of
     the new instance)
©2010 - Cesare Pautasso                            31
Interacting with a task
    GET
    /task/restbucks/order/1.0/0/payment




©2010 - Cesare Pautasso                   32
Interacting with a task
  POST /rest/restbucks/order/1.0/0/payment




©2010 - Cesare Pautasso                  33
Interacting with a resource
  GET /receipt/2fc7f6e2-8b43-4672-a7c4…




©2010 - Cesare Pautasso                   34
Interacting with a resource
  DELETE /rest/restbucks/order/1.0/0




©2010 - Cesare Pautasso                35
Deleting a process resource
  DELETE /rest/restbucks/order/1.0/0




©2010 - Cesare Pautasso                36
Viewpoints



                          Control        Data
                           Flow          Flow
                              Service
                              Bindings

     REST.TASK REST.URI         REST     WS-*   SQL   …
©2010 - Cesare Pautasso                                   37
Control
      Flow



           Control Flow
           Dependency




©2010 - Cesare Pautasso   38
Service
   Bindings


              SQL

             WS-*

             REST

         REST.URI

       REST.TASK


©2010 - Cesare Pautasso   39
REST.TASK




                          Specify the final state
                          of the Payment task



©2010 - Cesare Pautasso                             40
REST.URI




                          Specify the state
                          associated with the URI


©2010 - Cesare Pautasso                             41
Data
         Flow



               Data Flow
               (Copy)




©2010 - Cesare Pautasso    42
©2010 - Cesare Pautasso   43
Static vs. Dynamic Typing
      Myth: RESTful Web services cannot be
       composed (with BPEL) because they do
       not give a static contract description
      Reality: RESTful Web services can
       dynamically negotiate the most
       suitable representation format with
       their clients
      Challenge: How to support dynamic
       typing and content type negotiation in a
       BPM composition language?

©2010 - Cesare Pautasso                           44
Active Resources
      Myth: Processes cannot be mapped to
       resources because they can change
       their state (independently of their
       clients)
      Reality: REST Resources do not have to
       be passive “CRUD” services but can be
       active and have a life of their own.
      Challenge: How to best let clients
       control an active resource backed up
       by a process instance through the
       uniform interface?
©2010 - Cesare Pautasso                         45
Synchronous vs. Asychronous
      Myth: Processes run for a long time
       and need to interact asynchronously
       with their clients. This cannot be done
       with HTTP.
      Reality: HTTP supports non blocking
       interactions. Each process instance is
       mapped to a resource URI, which can
       be used by clients throughout its
       lifetime.
      Challenge: How to let processes send
       notifications back to their clients?
©2010 - Cesare Pautasso                          46
Conclusions
      REST resources are a good abstraction
       to publish processes on the Web
      RESTful HTTP is good enough to
       interact without any extension with
       process execution engines and drive
       the execution of process and task
       instances
      If done right, BPM can be a great
       modeling tool for Hypermedia-centric
       service design
       (and implementation!)
©2010 - Cesare Pautasso                        47
More Information

     Cesare Pautasso
     Faculty of Informatics, USI Lugano
     http://www.pautasso.info/
     @pautasso

     JOpera
     RESTful Process Engine
     http://www.jopera.org/
     @jopera_org
©2010 - Cesare Pautasso                   48
References
     R. Fielding, Architectural Styles and the Design of Network-
      based Software Architectures, PhD Thesis,
      University of California, Irvine, 2000
     C. Pautasso, O. Zimmermann, F. Leymann, RESTful Web
      Services vs. Big Web Services: Making the Right Architectural
      Decision, Proc. of the 17th International World Wide Web
      Conference (WWW2008), Bejing, China, April 2008
     C. Pautasso, BPEL for REST, Proc. of the 7th International
      Conference on Business Process Management
      (BPM 2008), Milano, Italy, September 2008
     C. Pautasso, Composing RESTful Services with JOpera,
      In: Proc. of the International Conference on Software
      Composition (SC2009), July 2009, Zurich, Switzerland.
©                                                                     49
Conclusion

                                     Raj Balasubramanian,
         Applying the SOA composition principle to
                                     Benjamin Carlyle,
                                     Thomas Erl,
          REST gives interesting results Pautasso,
                                     Cesare
         Thanks to hyperlinks, REST SOA with a new
                                      brings REST,
          (more dynamic and loosely coupled)
                                     Prentice Hall,
          twist to SOA composition to appear in 2011
      Composing RESTful services helps to build
       mashups, but is different
      A RESTful API is the perfect abstraction for
       publishing the state of a workflow


©2010 - Cesare Pautasso                                     50

Contenu connexe

Similaire à BPM with REST

WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful ServicesCesare Pautasso
 
RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOperaCesare Pautasso
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Cesare Pautasso
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Serviceselliando dias
 
Cesare Pautasso R E S T V1
Cesare  Pautasso    R E S T V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1SOA Symposium
 
Day1 Forrester Cloud Presentation
Day1 Forrester Cloud PresentationDay1 Forrester Cloud Presentation
Day1 Forrester Cloud PresentationErwinTheunissen
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation Enguest76d50b
 
Intalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンIntalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンTomoaki Sawada
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation EnSpagoWorld
 
Open APIs in Telecom - Workshop Fokus Berlin 2009
Open APIs in Telecom - Workshop Fokus Berlin 2009Open APIs in Telecom - Workshop Fokus Berlin 2009
Open APIs in Telecom - Workshop Fokus Berlin 2009Marc Schaer
 
Sap microsoft interoperability sitnl 08-12-2012
Sap microsoft interoperability sitnl 08-12-2012Sap microsoft interoperability sitnl 08-12-2012
Sap microsoft interoperability sitnl 08-12-2012Twan van den Broek
 
Tactics Esb Implementation
Tactics Esb ImplementationTactics Esb Implementation
Tactics Esb ImplementationMurali Manohar
 
WSO2 Mashups and BPM
WSO2 Mashups and BPMWSO2 Mashups and BPM
WSO2 Mashups and BPMWSO2
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End TestingErika Barron
 
Oracle SOA Suite Overview - Integration in a Service-Oriented World
Oracle SOA Suite Overview - Integration in a Service-Oriented WorldOracle SOA Suite Overview - Integration in a Service-Oriented World
Oracle SOA Suite Overview - Integration in a Service-Oriented WorldOracleContractors
 
Sql Server 2012 Reporting-Services is Now a SharePoint Service Application
Sql Server 2012   Reporting-Services is Now a SharePoint Service ApplicationSql Server 2012   Reporting-Services is Now a SharePoint Service Application
Sql Server 2012 Reporting-Services is Now a SharePoint Service ApplicationInnoTech
 

Similaire à BPM with REST (20)

WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful Services
 
RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOpera
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Services
 
Cesare Pautasso R E S T V1
Cesare  Pautasso    R E S T V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1
 
REST vs. SOAP
REST vs. SOAPREST vs. SOAP
REST vs. SOAP
 
Day1 Forrester Cloud Presentation
Day1 Forrester Cloud PresentationDay1 Forrester Cloud Presentation
Day1 Forrester Cloud Presentation
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation En
 
Intalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンIntalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョン
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation En
 
Bicocca Restws Pautasso Talk
Bicocca Restws Pautasso TalkBicocca Restws Pautasso Talk
Bicocca Restws Pautasso Talk
 
Www2008 Restws Pautasso Talk
Www2008 Restws Pautasso TalkWww2008 Restws Pautasso Talk
Www2008 Restws Pautasso Talk
 
Open APIs in Telecom - Workshop Fokus Berlin 2009
Open APIs in Telecom - Workshop Fokus Berlin 2009Open APIs in Telecom - Workshop Fokus Berlin 2009
Open APIs in Telecom - Workshop Fokus Berlin 2009
 
Sap microsoft interoperability sitnl 08-12-2012
Sap microsoft interoperability sitnl 08-12-2012Sap microsoft interoperability sitnl 08-12-2012
Sap microsoft interoperability sitnl 08-12-2012
 
Tactics Esb Implementation
Tactics Esb ImplementationTactics Esb Implementation
Tactics Esb Implementation
 
WSO2 Mashups and BPM
WSO2 Mashups and BPMWSO2 Mashups and BPM
WSO2 Mashups and BPM
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End Testing
 
Oracle SOA Suite Overview - Integration in a Service-Oriented World
Oracle SOA Suite Overview - Integration in a Service-Oriented WorldOracle SOA Suite Overview - Integration in a Service-Oriented World
Oracle SOA Suite Overview - Integration in a Service-Oriented World
 
Sql Server 2012 Reporting-Services is Now a SharePoint Service Application
Sql Server 2012   Reporting-Services is Now a SharePoint Service ApplicationSql Server 2012   Reporting-Services is Now a SharePoint Service Application
Sql Server 2012 Reporting-Services is Now a SharePoint Service Application
 
IT Governance Portals
IT Governance   PortalsIT Governance   Portals
IT Governance Portals
 

Plus de Cesare Pautasso

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteCesare Pautasso
 
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?Cesare Pautasso
 
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Cesare Pautasso
 
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremCesare Pautasso
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software ConnectorCesare Pautasso
 
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Cesare Pautasso
 
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesCesare Pautasso
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionCesare Pautasso
 
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiCesare Pautasso
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresCesare Pautasso
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate MemberCesare Pautasso
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Cesare Pautasso
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOperaCesare Pautasso
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Cesare Pautasso
 

Plus de Cesare Pautasso (20)

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 Keynote
 
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?
 
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?
 
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC Theorem
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software Connector
 
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...
 
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web Services
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process Execution
 
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service Geografici
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on Multicores
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate Member
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
Mashups09
Mashups09Mashups09
Mashups09
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOpera
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Services
 
Mashup Ecosystem
Mashup EcosystemMashup Ecosystem
Mashup Ecosystem
 
Mashup Atelier
Mashup AtelierMashup Atelier
Mashup Atelier
 
MetaCDN
MetaCDNMetaCDN
MetaCDN
 

Dernier

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
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 WorkerThousandEyes
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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.pdfsudhanshuwaghmare1
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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 FresherRemote DBA Services
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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 educationjfdjdjcjdnsjd
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Dernier (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
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
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

BPM with REST

  • 1. Business Process Management with REST Cesare Pautasso Faculty of Informatics University of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info @pautasso
  • 2. BPM REST ©2010 - Cesare Pautasso 2
  • 3. Business RESTful Process Web Services Management ©2010 - Cesare Pautasso 3
  • 4. WS-* Standards Stack ©2009-2010 - Cesare Pautasso - 30.6.2010 4
  • 5. WS-* Standards Stack BPM Management Interoperability Transactions Security Reliability Metadata State Messaging ©2009-2010 - Cesare Pautasso - 30.6.2010 5
  • 6. BPM Management Interoperability Transactions Security Reliability Metadata State Messaging Can you do it with REST? ©2010 - Cesare Pautasso 6
  • 7. From REST-* (JBoss) “ We believe there is huge potential to http://www.jboss.org/reststar/specifications/workflow.html marrying REST with workflow and BPM. […] Combined with the architecture of the Web, a workflow service can provide both a truly simple, portable, and flexible way to build workflow driven integrations and ” applications. ©2010 - Cesare Pautasso 7
  • 8. Business Process Management BPMN/WS-BPEL Workflow Workflow Process Model Users/Clients Participants Act 2 Act 4 Act 1 Act 5 Act 7 Act 3 Act 6 Workflow Management Engine Workflow Modelers Adapters Bus Applications Web Services Databases ©2010 - Cesare Pautasso 8
  • 9. WS-BPEL Primitives Web <receive> <invoke> Service <reply> <invoke> Web <receive> Service  The modeling language natively supports the RPC or message-based connectors ©2010 - Cesare Pautasso 9
  • 10. What is your SOA connector today? RPC ESB REST/HTTP ©2010 - Cesare Pautasso 10
  • 11. REST as a new connector RPC ESB Publish/Subscribe Call REST/HTTP Get/Put/Post/Delete ©2010 - Cesare Pautasso 11
  • 12. Is REST really used? Atom, 2% Gdata, 1% XMPP, 0% JavaScript, 6% XML-RPC, 2% SOAP, 17% JSON-RPC, 0% SMS, 2042 APIs 0% RSS, 1% ProgrammableWeb.com 30.6.2010 REST, 71% ©2010 - Cesare Pautasso 12
  • 13. REST in one slide  Web Services expose their data and functionality trough PUT resources identified by URI R  Uniform Interface Principle: GET Clients interact with resources POST through a fix set of verbs. DELETE Example HTTP: GET (read), PUT (update), DELETE, POST (catch all),  Multiple representations for the same resource  Hyperlinks model resource relationships and valid state transitions for dynamic protocol description and discovery ©2010 - Cesare Pautasso 13
  • 14. Business Process Management Workflow Workflow Process Model Users/Clients Participants Act 2 Act 4 Act 1 Act 5 Act 7 Act 3 Act 6 RESTful Workflow Management Engine PUT GET R Adapters Bus Applications Web Services POST DELETE Databases ©2010 - Cesare Pautasso 14
  • 15. BPM with REST Process Model Publishing Act 2 Act 4 R Processes Act 1 Act 5 Act 7 as Resources Act 3 Act 6 RESTful Workflow Management Engine RESTful Service R R R Composition ©2010 - Cesare Pautasso 15
  • 16. BPM with REST Publishing This talk will R Processes focus here as Resources RESTful Workflow Management Engine RESTful Service R R R Composition ©2010 - Cesare Pautasso 16
  • 17. Some Challenges for BPM engines  Can you drive the execution of tasks with PUT/POST/DELETE requests?  Can you monitor your processes with an RSS/ATOM feed?  Can you bookmark a process instance?  Can you send an email to your colleague with a link to a task from your worklist?  Can you ask a process to give you links to its tasks left to be done?  Can you publish your process as a resource?  Can you publish resources from your process?  Can you call RESTful APIs directly? ©2010 - Cesare Pautasso 17
  • 18. BPM REST  Processes  Resources/URIs  Tasks  Uniform  Control Flow Interface  Data Flow  Representations …  Hypermedia ©2010 - Cesare Pautasso 18
  • 19. Everything is a resource /process/X /process/X/1 Process Process Instance Task Task Instance /task/Y /task/Y/1 ©2010 - Cesare Pautasso 19
  • 20. Hypermedia /process Process Process Instance GET /process/name Task Task Instance GET /process/name/instance GET /process/name/instance/taskname Follow links to discover the processes deployed as resources ©2010 - Cesare Pautasso 20
  • 21. Representations Web page with form to start List of process a new process input parameters instance ContentType: ContentType: text/html application/xml GET /process/name ContentType: ContentType: text/plain application/json ContentType: Basic textual Process description image/svg+xml metadata of the process in JSON ©2010 - Cesare Pautasso 21
  • 22. Uniform Interface and Hypermedia List the GET /process deployed Get a form processes describing how GET /process/name to start the process Start a new POST /process/name process instance Check what is the state GET /process/name/instance of the instance DELETE /process/name/instance Clean up (once it is done) ©2010 - Cesare Pautasso 22
  • 23. Starting or Running a new process? /process  Should the client be kept waiting for the process to run until completion? POST /process 200 OK  Clients may want to block until (Process the whole process has Finished completed its execution Reply) (or it decides to reply to them) ©2010 - Cesare Pautasso 23
  • 24. Starting or Running a new process? /process  The client starting a long running process is redirected to a location x representing the POST /process newly started process instance  The process and the client run 202 Accepted asynchronously Location: x  The client may retrieve the current state of the process GET /process/x instance at any time 200 OK ©2010 - Cesare Pautasso 24
  • 25. Uniform Interface and Hypermedia GET /task List the active tasks Get a form describing how GET /task/name/instance to perform the task Finish POST /task/name/instance the task GET /task/name/instance Get the final representation of the completed … task ©2010 - Cesare Pautasso 25
  • 26. POST or PUT? GET /task Note: PUT could also be used here GET /task/name/instance to set the state (Finished, Failed) of the task POST /task/name/instance GET /task/name/instance … ©2010 - Cesare Pautasso 26
  • 27. Example: RESTBucks Jim Webber, Savas Parastatidis, Ian Robinson http://restinpractice.com/ 27
  • 28. Simple RESTBucks Example POST /rest/restbucks/order/1.0/ /rest/restbucks/order/1.0/{id} GET /tasks/restbucks/order/1.0/{id}/payment POST GET /receipt/{uuid} ©2010 - Cesare Pautasso 28
  • 29. Simple RESTBucks Example Hypermedia-centric service design (and implementation) done with a business process model Private Tasks Resources ©2010 - Cesare Pautasso 29
  • 30. Instantiating a process GET /rest/restbucks/order/1.0/ Retrieve a form which describes how to instantiate a new process ©2010 - Cesare Pautasso 30
  • 31. Instantiating a process POST /rest/restbucks/order/1.0/ Run = blocking (client waits until Start = non blocking the process replies) (redirect to URI of the new instance) ©2010 - Cesare Pautasso 31
  • 32. Interacting with a task GET /task/restbucks/order/1.0/0/payment ©2010 - Cesare Pautasso 32
  • 33. Interacting with a task POST /rest/restbucks/order/1.0/0/payment ©2010 - Cesare Pautasso 33
  • 34. Interacting with a resource GET /receipt/2fc7f6e2-8b43-4672-a7c4… ©2010 - Cesare Pautasso 34
  • 35. Interacting with a resource DELETE /rest/restbucks/order/1.0/0 ©2010 - Cesare Pautasso 35
  • 36. Deleting a process resource DELETE /rest/restbucks/order/1.0/0 ©2010 - Cesare Pautasso 36
  • 37. Viewpoints Control Data Flow Flow Service Bindings REST.TASK REST.URI REST WS-* SQL … ©2010 - Cesare Pautasso 37
  • 38. Control Flow Control Flow Dependency ©2010 - Cesare Pautasso 38
  • 39. Service Bindings SQL WS-* REST REST.URI REST.TASK ©2010 - Cesare Pautasso 39
  • 40. REST.TASK Specify the final state of the Payment task ©2010 - Cesare Pautasso 40
  • 41. REST.URI Specify the state associated with the URI ©2010 - Cesare Pautasso 41
  • 42. Data Flow Data Flow (Copy) ©2010 - Cesare Pautasso 42
  • 43. ©2010 - Cesare Pautasso 43
  • 44. Static vs. Dynamic Typing  Myth: RESTful Web services cannot be composed (with BPEL) because they do not give a static contract description  Reality: RESTful Web services can dynamically negotiate the most suitable representation format with their clients  Challenge: How to support dynamic typing and content type negotiation in a BPM composition language? ©2010 - Cesare Pautasso 44
  • 45. Active Resources  Myth: Processes cannot be mapped to resources because they can change their state (independently of their clients)  Reality: REST Resources do not have to be passive “CRUD” services but can be active and have a life of their own.  Challenge: How to best let clients control an active resource backed up by a process instance through the uniform interface? ©2010 - Cesare Pautasso 45
  • 46. Synchronous vs. Asychronous  Myth: Processes run for a long time and need to interact asynchronously with their clients. This cannot be done with HTTP.  Reality: HTTP supports non blocking interactions. Each process instance is mapped to a resource URI, which can be used by clients throughout its lifetime.  Challenge: How to let processes send notifications back to their clients? ©2010 - Cesare Pautasso 46
  • 47. Conclusions  REST resources are a good abstraction to publish processes on the Web  RESTful HTTP is good enough to interact without any extension with process execution engines and drive the execution of process and task instances  If done right, BPM can be a great modeling tool for Hypermedia-centric service design (and implementation!) ©2010 - Cesare Pautasso 47
  • 48. More Information Cesare Pautasso Faculty of Informatics, USI Lugano http://www.pautasso.info/ @pautasso JOpera RESTful Process Engine http://www.jopera.org/ @jopera_org ©2010 - Cesare Pautasso 48
  • 49. References  R. Fielding, Architectural Styles and the Design of Network- based Software Architectures, PhD Thesis, University of California, Irvine, 2000  C. Pautasso, O. Zimmermann, F. Leymann, RESTful Web Services vs. Big Web Services: Making the Right Architectural Decision, Proc. of the 17th International World Wide Web Conference (WWW2008), Bejing, China, April 2008  C. Pautasso, BPEL for REST, Proc. of the 7th International Conference on Business Process Management (BPM 2008), Milano, Italy, September 2008  C. Pautasso, Composing RESTful Services with JOpera, In: Proc. of the International Conference on Software Composition (SC2009), July 2009, Zurich, Switzerland. © 49
  • 50. Conclusion Raj Balasubramanian,  Applying the SOA composition principle to Benjamin Carlyle, Thomas Erl, REST gives interesting results Pautasso, Cesare  Thanks to hyperlinks, REST SOA with a new brings REST, (more dynamic and loosely coupled) Prentice Hall, twist to SOA composition to appear in 2011  Composing RESTful services helps to build mashups, but is different  A RESTful API is the perfect abstraction for publishing the state of a workflow ©2010 - Cesare Pautasso 50