ECSA'15 - Modeling REST-ful conversations

Preview:

Citation preview

Modeling RESTful Conversations with Extended

BPMN Choreography Diagrams

Cesare Pautasso, Ana IvanchikjUniversity of Lugano (USI)

Switzerland

Silvia SchreierinnoQ Deutschland GmbH

Germany

European Conference on Software Architecture Cavtat, September 7-11

ECSA 2015

ana.ivanchikj@usi.ch

2

RESTful conversation

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

Resource

URI

Resource

URI

Resource

URI

GET URI GET URI

PUT U

RI

reference create

Link Relationships (Hypermedia)

303 See Other

200 OK

ana.ivanchikj@usi.ch

3

RESTful conversation

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

Resource

URI

Resource

URI

Resource

URI

GET URI GET URI

PUT U

RI

reference create

Link Relationships (Hypermedia)

303 See Other

201 Created

200 OK

ana.ivanchikj@usi.ch

4

REST API structure - RAML

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

5

REST API structure- Swagger

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

6

GET /resource 1 HTTP/1.1

HTTP/1.1 303 See OtherLocation: /resource2GET /resource2 HTTP/1.1

HTTP/1.1 200 OK

REST API dynamics

UML Sequence diagram BPMN Choreography diagram

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

- Redirect -

ana.ivanchikj@usi.ch

7

BPMN Choreography

Inclusive gateway

Parallel gateway

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Exclusive gateway

ana.ivanchikj@usi.ch

8

GET /resource 1 HTTP/1.1

HTTP/1.1 303 See OtherLocation: /resource2GET /resource2 HTTP/1.1

HTTP/1.1 200 OK

REST API dynamics

UML Sequence diagram BPMN Choreography diagram Our proposal

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

- Redirect -

ana.ivanchikj@usi.ch

9

Extended BPMN Choreography

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Assumption:ONE client – ONE server

ana.ivanchikj@usi.ch

10REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

11REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

12REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

13

Long-running Request-RESTful Conversation Example-

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

e.g.: http://docs.aws.amazon.com/amazonglacier/latest/dev/job-operations.html

ana.ivanchikj@usi.ch

14

Long-running Request- Happy path -

Create job POST / job HTTP/1.1

HTTP/1.1 202 AcceptedLocation: / job / 42

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

ana.ivanchikj@usi.ch

15

Long-running Request- Resending the request -

Create job POST / job HTTP/1.1

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

ana.ivanchikj@usi.ch

16

Long-running Request- Reading the results -

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Create job POST / job HTTP/1.1

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

ana.ivanchikj@usi.ch

17

Long-running Request- Deleting the output resource -

Delete output DELETE / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Create job POST / job HTTP/1.1

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

ana.ivanchikj@usi.ch

18

Long-running Request- Deleting the output resource -

Delete output DELETE / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Create job POST / job HTTP/1.1

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

ana.ivanchikj@usi.ch

19

Long-running Request

Clean up DELETE / job / 42 HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Delete output DELETE / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

Create job POST / job HTTP/1.1

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

- Deleting the job resource -

ana.ivanchikj@usi.ch

20

Long-running Request

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Create job POST / job HTTP/1.1

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

Delete job DELETE / job / 42 HTTP/1.1

HTTP/1.1 200 OK

- Deleting the job resource -

ana.ivanchikj@usi.ch

21

Long-running Request

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

22

Long-running Request- Short happy path -

Create job POST / job HTTP/1.1

HTTP/1.1 202 AcceptedLocation: / job / 42

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

ana.ivanchikj@usi.ch

23

Long-running Request

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

24

Long-running Request- Long unhappy path -

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Delete output DELETE / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

Create job POST / job HTTP/1.1

Read results GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

HTTP/1.1 202 AcceptedLocation: / job / 42

POST / job HTTP/1.1

GET / job / 42 / output HTTP/1.1

HTTP/1.1 200 OK

Poll GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

GET / job / 42 HTTP/1.1

HTTP/1.1 303 See OtherLocation: / job / 42 / output

GET / job / 42 HTTP/1.1

HTTP/1.1 200 OK

Delete job DELETE / job / 42 HTTP/1.1

HTTP/1.1 200 OK

ana.ivanchikj@usi.ch

25

Long-running Request-BPMN Choreography-

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

26

Long-running Request-Extended BPMN Choreography-

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

27

Abstractions and Simplifications

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

28

Abstraction – Server Error Response

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

29

Abstraction – Idempotent requests

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

30

Simplification – End events

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

31

Simplification - Hyperlinks

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

32

Simplifications and abstractions summary

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

ana.ivanchikj@usi.ch

33

• Survey– Understandability– Ease of use

Future Work

• Conversation Patterns – Expressiveness– Collection– Reusability

REST BPMN Choreography Extended BPMN Choreography Example Model Abstractions and Simplifications Future work

Contact us at:ana.ivanchikj@usi.ch

c.pautasso@ieee.orgsilvia.schreier@innoq.com

Contribute to our research by filling in the survey!!!http://restfulconversations.limequery.com/index.php/215135/lang-en

Recommended