Push-Enabling RESTful Business Processes

2f40cbf5c009290a2ab513768de249d1?s=47 pautasso
December 11, 2011

Push-Enabling RESTful Business Processes

Presentation given at the 9th International Conference on Service-Oriented Computing (ICSOC 2011) on 6.12.2011

2f40cbf5c009290a2ab513768de249d1?s=128

pautasso

December 11, 2011
Tweet

Transcript

  1. 1.

    Push-Enabling RESTful Business Processes Cesare Pautasso Faculty of Informatics, University

    of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info @pautasso 6.12.2011 Erik Wilde EMC dret@dret.net http://dret.net @dret
  2. 2.

    RESTful Business Processes Cesare Pautasso Faculty of Informatics, University of

    Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info @pautasso 6.12.2011 Erik Wilde EMC dret@dret.net http://dret.net @dret
  3. 3.

    Abstract  Representational State Transfer (REST) as an architectural style

    for service design has seen substantial uptake in the past years. However, some areas such as Business Process Modeling (BPM) and push services so far have not been addressed in the context of REST principles.  In this work, we look at how both BPM and push can be combined so that business processes can be modeled and observed in a RESTful way. Based on this approach, clients can subscribe to be notied when certain states in a business process are reached. Our goal is to design an architecture that brings REST's claims of loose coupling and good scalability to the area of BPM, and still allow process-driven composition and interaction between resources to be modeled. ©2011 - Cesare Pautasso 3
  4. 9.

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

    Interoperability Metadata Reliability Security Transactions State Messaging Management BPM
  5. 10.

    ©2011 - Cesare Pautasso 10 Interoperability Metadata Reliability Security Transactions

    State Messaging Management BPM Can you do it with REST?
  6. 11.

    ©2011 - Cesare Pautasso 11 We believe there is huge

    potential to 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. From REST-* http://www.jboss.org/reststar/specifications/workflow.html “ ”
  7. 12.

    ©2011 - Cesare Pautasso 12  Web Services expose their

    data and functionality trough resources identified by URI  Uniform Interface constraint: Clients interact with resources through a fix set of verbs. Example HTTP: GET (read), POST (create), PUT (update), DELETE  Multiple representations for the same resource  Hyperlinks model resource relationships and valid state transitions for dynamic protocol description and discovery REST in one slide R PUT DELETE GET POST
  8. 13.

    ©2011 - Cesare Pautasso 13 We believe there is huge

    potential to marrying REST with workflow and BPM.  The HATEOAS (hypermedia and linking) principal of REST is logically a dynamic state machine and fits very well with how workflow and BPM systems are designed.  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. From REST-* http://www.jboss.org/reststar/specifications/workflow.html “
  9. 14.

    ©2011 - Cesare Pautasso 14 RESTful Workflow Management Engine Act

    1 Act 2 Act 3 Act 7 Act 6 Act 5 Act 4 Web Services Process Model Applications Adapters Workflow Users/Clients Workflow Participants Business Process Management Databases Bus R PUT DELETE GET POST
  10. 15.

    ©2011 - Cesare Pautasso 15 RESTful Workflow Management Engine Act

    1 Act 2 Act 3 Act 7 Act 6 Act 5 Act 4 Process Model BPM with REST R R RESTful Service Composition R R Publishing Processes as Resources
  11. 16.

    ©2011 - Cesare Pautasso 16 RESTful Workflow Management Engine BPEL

    for REST BPMN for REST BPM with REST R R RESTful Service Composition R R Publishing Processes as Resources
  12. 17.

    ©2011 - Cesare Pautasso 17 RESTful Workflow Management Engine We

    are here BPM with REST R R RESTful Service Composition R R Publishing Processes as Resources
  13. 18.

    ©2011 - Cesare Pautasso 18 BPM REST  Resources/URIs 

    Uniform Interface  Representations  Hypermedia  Processes  Tasks  Control Flow  Data Flow  …
  14. 19.

    ©2011 - Cesare Pautasso 19 Everything is a resource Process

    Process Instance Task Task Instance /process/X /task/Y /task/Y/1 /process/X/1
  15. 20.

    ©2011 - Cesare Pautasso 20 Hypermedia Process Process Instance Task

    Task Instance /process /process/name /process/name/instance Follow links to discover the processes deployed as resources /process/name/instance/taskname GET GET GET
  16. 21.

    ©2011 - Cesare Pautasso 21 Representations /process/name GET ContentType: text/html

    ContentType: application/bpmn+xml ContentType: text/plain ContentType: application/json ContentType: image/svg+xml Web page with form to start a new process instance Basic textual description of the process Process metadata in JSON BPMN2.0 process source code
  17. 22.

    ©2011 - Cesare Pautasso 22 Uniform Interface and Hypermedia /process

    /process/name GET GET GET /process/name POST /process/name/instance DELETE /process/name/instance List the deployed processes Get a form describing how to start the process Start a new process instance Check what is the state of the instance Clean up (once it is done)
  18. 23.

    ©2011 - Cesare Pautasso 23 Starting or Running processes? POST

    /process  Should the client be kept waiting for the process to run until completion?  Clients may want to block until the whole process has completed its execution (or it decides to reply to them) /process 200 OK (Process Finished Reply)
  19. 24.

    ©2011 - Cesare Pautasso 24 Starting or Running processes? POST

    /process GET /process/x  The client starting a long running process is redirected to a location x representing the newly started process instance  The process and the client run asynchronously  The client may retrieve the current state of the process instance at any time /process 202 Accepted Location: x 200 OK
  20. 25.

    ©2011 - Cesare Pautasso 25 Push vs. Pull Notification /process

    PULL PUSH GET /process/x 200 OK  Problem: how can the process instance tell the client that it has reached a certain state?  Easy to use a PULL-based event notification with HTTP  Can we also support PUSH- based event notification with HTTP?
  21. 26.

    Push-Enabling RESTful Business Processes Cesare Pautasso Faculty of Informatics, University

    of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info @pautasso 6.12.2011 Erik Wilde EMC dret@dret.net http://dret.net @dret
  22. 28.

    ©2011 - Cesare Pautasso 28 REST as a new connector

    RPC BUS REST/HTTP Call Publish/Subscribe Get/Put/Post/Delete
  23. 29.

    ©2011 - Cesare Pautasso 29 What about event notifications? RPC

    BUS REST/HTTP Callback Publish/Subscribe Get/Put/Post/Delete ?
  24. 30.

    ©2011 - Cesare Pautasso 30 Solutions 1.Web Feeds (PubSubHubbub) 2.HTTP

    Long Polling 3.Inverted REST (HTTP Callbacks) 4.WebSockets 5.(XMPP)
  25. 31.
  26. 32.

    32 Representations /process/name/instance GET ContentType: application/atom+xml Web feed representing the

    current state of the process instance (collection of task instances)
  27. 33.

    ©2011 - Cesare Pautasso 33 Loan Approval Example Task Published

    as a Resource Process Published as a Resource External Resources
  28. 34.

    ©2011 - Cesare Pautasso 34 Process as a Web Feed

    <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Loan Approval Process</title> <subtitle>Instance x</subtitle> <link href="http://rest.jopera.org/loan/x" rel="self" /> <link href="http://rest.jopera.org/loan" rel="template" /> <link href="http://pubsubhubbub.appspot.com/" rel="hub" /> <id>http://rest.jopera.org/loan/x</id> <updated>2011-06-10T11:11:30Z</updated> <author><name>Cesare Pautasso</name><email>cp@jopera.org</email></author> <entry> <title>Choose Task (Ready)</title> <link href="http://rest.jopera.org/loan/x/choose" /> <id>http://rest.jopera.org/loan/x/choose</id> <updated>2011-06-10T11:12:20Z</updated> <summary>State: ready</summary> </entry> <entry> <title>Approve Task (Waiting)</title> <link href="http://rest.jopera.org/loan/x/approve" /> <id>http://rest.jopera.org/loan/x/approve</id> <updated>2011-06-10T11:11:30Z</updated> <summary>State: waiting</summary> </entry> </feed>
  29. 35.

    ©2011 - Cesare Pautasso 35 Feed  Feed  Feed

    Entry  Feed Author  Summary  Updated  Link  Process Instance  Task  Process User  Task State  Task Timestamp  Task Instance URI BPM
  30. 36.

    ©2011 - Cesare Pautasso 36 Link Relations <?xml version="1.0" encoding="utf-8"?>

    <feed xmlns="http://www.w3.org/2005/Atom"> <title>Loan Approval Process</title> <subtitle>Instance x</subtitle> <link href="http://rest.jopera.org/loan/x" rel="self"/> <link href="http://rest.jopera.org/loan" rel="template”/> <link href="http://pubsubhubbub.appspot.com/" rel="hub“/> <id>http://rest.jopera.org/loan/x</id> </feed> Process Process Instance Template Self
  31. 37.

    ©2011 - Cesare Pautasso 37 PubSubHubbub Feed Consumer Feed Producer

    Hub Feed Hub Subscribe Ping Get Notify/Poll
  32. 39.

    Conclusion  Thanks to hypermedia, URIs and the HTTP uniform

    interface, REST resources are a very good abstraction to publish executable business processes on the Web  RESTful HTTP is good enough to interact without any extension with process execution engines to drive the execution of process and task instances and to deliver notifications  The state of a process instance can be projected to be represented as a standard Web feed  The PubSubHubbub protocol can be used as an optimization to scale the corresponding delivery of notication callbacks ©2011 - Cesare Pautasso 39
  33. 40.

    ©2009-2010 - Cesare Pautasso, Erik Wilde 40 References  Roy

    Fielding, Architectural Styles and the Design of Network-based Software Architectures, PhD Thesis, University of California, Irvine, 2000  Leonard Richardson, Sam Ruby, RESTful Web Services, O’Reilly, May 2007  Jim Webber, Savas Parastatidis, Ian Robinson, REST in Practice: Hypermedia and Systems Architecture, O‘Reilly, 2010  Subbu Allamaraju, RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity, O’Reilly, 2010  Stevan Tilkov, HTTP und REST, dpunkt Verlag, 2009, http://rest-http.info/  Thomas Erl, Raj Balasubramanians, Cesare Pautasso, Benjamin Carlyle, SOA with REST, Prentice Hall, end of 2010  Martin Fowler, Richardson Maturity Model: steps toward the glory of REST, http://martinfowler.com/articles/richardsonMaturityModel.html
  34. 41.

    ©2009-2010 - Cesare Pautasso, Erik Wilde 41 Self-References  Cesare

    Pautasso, Olaf Zimmermann, Frank 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.  Cesare Pautasso and Erik Wilde. Why is the Web Loosely Coupled? A Multi- Faceted Metric for Service Design, Proc of the 18th International World Wide Web Conference (WWW2009), Madrid, Spain, April 2009.  Cesare Pautasso, BPEL for REST, Proc. of the 6th International Conference on Business Process Management (BPM 2008), Milan, Italy, September 2008.  Cesare Pautasso, BPMN for REST, Proc. of the 3rd BPMN Workshop (BPMN 2011), Luzern, Switzerland, November 2011  Cesare Pautasso, RESTful Web Service Composition with JOpera, Proc. Of the International Conference on Software Composition (SC 2009), Zurich, Switzerland, July 2009.  Cesare Pautasso, Gustavo Alonso: From Web Service Composition to Megaprogramming In: Proceedings of the 5th VLDB Workshop on Technologies for E-Services (TES-04), Toronto, Canada, August 2004.
  35. 42.

    ©2011 - Cesare Pautasso 42 Raj Balasubramanians, Benjamin Carlyle, Thomas

    Erl, Cesare Pautasso, SOA with REST, Prentice Hall, 2012
  36. 43.

    ©2011 - Cesare Pautasso 43 10th International Conference on Business

    Process Management (BPM 2012) September 3-6 2012, Tallinn, Estonia http://bpm2012.ut.ee