model driven exception handling in web applications

31
1 Exception Handling in Workflow-driven Web Applications by Marco Brambilla http://home.dei.polimi.it/mbrambil http://twitter.com/MarcoBrambi http://www.slideshare.net/ mbrambil Based on our WWW 2005 paper: M. Brambilla, S. Ceri, S. Comai, C. Tziviskou. "Exception Handling in Workflow- Driven Web Applications", WWW 2005 International Conference, Chiba (Japan), May 10-13 2005, ACM, pp. 170- 179 Politecnico di Milano

Upload: marco-brambilla

Post on 24-Jan-2015

1.408 views

Category:

Technology


0 download

DESCRIPTION

As the Web becomes a platform for implementing B2B applications, the need arises of Web conceptual models for describing Web oriented workflow applications implementing business processes. In this context, new problems about process correctness arise, due to the loose control of Web applications upon the behavior of their Web clients. Indeed, incoherent user's behavior can lead to inconsistent processes.This paper presents a high level approach to the management of exceptions that occur during the execution of processes on the Web. We present a classification of exceptions that can be raised inside workflow-driven Web applications, and recovery policies to retrieve coherent status and data after an exception. We devise these concepts at high level and then we exploit them using a Web modeling language (WebML) that in turn provides development facilities like automatic code generation, validation of hypertext models, and so on. An industrial implementation experience is briefly presented too.

TRANSCRIPT

Page 1: Model driven exception handling in Web applications

1

Exception Handling in Workflow-driven Web Applications

by Marco Brambilla

http://home.dei.polimi.it/mbrambil http://twitter.com/MarcoBrambi

http://www.slideshare.net/mbrambil

Based on our WWW 2005 paper: M. Brambilla, S. Ceri, S. Comai, C. Tziviskou. "Exception Handling in Workflow-Driven Web

Applications", WWW 2005 International Conference, Chiba (Japan), May 10-13 2005, ACM, pp. 170-179

Politecnico di Milano

Page 2: Model driven exception handling in Web applications

2

Table of Contents

• Workflow-driven Web applications

• Exceptions in workflow-driven Web applications

• Handling Approach

• Implementation in WebMLExceptions

Handling Approach

Implementationin WebML

Workflow-drivenWeb applications

Page 3: Model driven exception handling in Web applications

3

Table of Contents

• Workflow-driven Web applications

• Process example

• Hypertext modeling

• Exceptions in workflow-driven Web applications

• Handling Approach

• Implementation in WebML

Exceptions

Handling Approach

Implementationin WebML

Workflow-drivenWeb applications

Page 4: Model driven exception handling in Web applications

4

Workflow-driven Web applications

• Example: Loan Request Process

Loan Search Loan Request

PreliminaryValidation

Financial Check

Job Check

Loan Acceptance

Final ApprovalE

MMC C

E

E

M C

Page 5: Model driven exception handling in Web applications

5

Workflow-driven Web applications

• Example: Loan Request Process & Hypertext Modeling

Loan Search Loan Request

PreliminaryValidation

Financial Check

Job Check

Loan Acceptance

Final ApprovalE

MMC C

E

E

M C

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Page 6: Model driven exception handling in Web applications

6

Table of Contents

• Workflow-driven Web applications

• Exceptions in workflow-driven Web applications

• Exception examples

• Classification based on exception type

• Classification based on detection time

• Handling Approach

• Implementation in WebML

Exceptions

Handling Approach

Implementationin WebML

Workflow-drivenWeb applications

Page 7: Model driven exception handling in Web applications

7

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Exceptions in Workflow-driven Web applications 1/7

• Example: Wrong Starting Page Exception

Page 8: Model driven exception handling in Web applications

8

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Exceptions in Workflow-driven Web applications 2/7

• Example: Action By Completed Activity Exception

Page 9: Model driven exception handling in Web applications

9

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Exceptions in Workflow-driven Web applications 3/7

• Example: Activity Already Active Exception

Page 10: Model driven exception handling in Web applications

10

Exceptions in Workflow-driven Web applications 4/7

• Example: Invalid Loan Amount Exception

• Example: Cancel Exception

• Example: Discount Rate Variation Exception

• Example: Expiration Date Modification Exception

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Page 11: Model driven exception handling in Web applications

11

Exceptions in Workflow-driven Web applications 5/7

• Example: Session End Exception

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Page 12: Model driven exception handling in Web applications

12

Exceptions in Workflow-driven Web applications 6/7

• Classification Based on Exception Type:– Behavioral: fault user navigation

» Wrong Starting Page

» Action By Completed Activity

» Activity Already Active

– Semantic: process negative logical outcome» Invalid Loan Amount

» Discount Rate Variation

» Cancel

» Expiration Date Modification

– System: communication failure» Session End

Page 13: Model driven exception handling in Web applications

13

Exceptions in Workflow-driven Web applications 7/7

• Classification Based on Detection Time: – Synchronous: user session is on

– Asynchronous: user session may be on or off

Page 14: Model driven exception handling in Web applications

14

Table of Contents

• Workflow-driven Web applications

• Exceptions in workflow-driven Web applications

• Handling Approach

• Exception metadata model

• Capturing – Notifying – Handling model

• Implementation in WebML

Exceptions

Handling Approach

Implementationin WebML

Workflow-drivenWeb applications

Page 15: Model driven exception handling in Web applications

15

Handling Approach 1/11

• Exception Metadata Model

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

Page 16: Model driven exception handling in Web applications

16

Handling Approach 2/11

• Capturing Model– Based on the exceptions type:

» Behavioral

» Semantic

» System

– Composed of:

» Triggers

» Web Services

Page 17: Model driven exception handling in Web applications

17

Handling Approach 3/11

• Capturing Model for Behavioral exceptions– Triggers on workflow metadata

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

Workflow metadata

EVENT update the Current Page for the Current ActivityCONDITION user navigation is not initiated from the last visited page ACTION create a new Exception Instance of type 'Wrong Starting Page'

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

Exception metadata

Page 18: Model driven exception handling in Web applications

18

Handling Approach 4/11

• Capturing Model for Semantic exceptions– Triggers on application data

– Web services called by external/internal applications

EVENT update the 'Discount Rate Variation' attribute for the Country entityCONDITION true ACTION create a new Exception Instance of type 'Discount Rate Variation' and connect it to Loan Requests cases fulfilled based on Installment Plans proposed by the Country

Remote Applications

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

Exception metadata

Application data

Processpage

MessageSOAP

MessageSOAP

Page 19: Model driven exception handling in Web applications

19

Handling Approach 5/11

• Capturing Model for System exceptions– Web services called by the Web Server

Web Server

0:N 1:1

Affects

Process

Case

Activity Type

Activity Inst.

Group

User

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:1

Type

0:N 1:1

Affects

Loan Request Loan Proposal

Current Page

PageUrlStartingPage

1:10:1

Current

InstPayment Instal. Plan

ManagedBy0:N 1:1

Country

APPLICATION MODEL

WORKFLOW META-MODEL EXCEPTION META-MODEL

Exception metadata

MessageSOAP

Page 20: Model driven exception handling in Web applications

20

Handling Approach 6/11

• Notifying Model– Based on the exceptions detection time:

» Synchronous

» Asynchronous

– Composed of:

» Exception-aware links

» Exception control unit

Page 21: Model driven exception handling in Web applications

21

Handling Approach 7/11

• Notifying Model for Synchronous exceptions– Exception-aware links

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

SomepageE E E E

Page 22: Model driven exception handling in Web applications

22

Handling Approach 8/11

• Notifying Model for Asynchronous exceptions– Exception Control unit

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Exceptionpage

Control

Page 23: Model driven exception handling in Web applications

23

Handling Approach 9/11

• Handling Model– Based on the exceptions detection time:

» Synchronous» Asynchronous

– Composed of:» Predefined policies: resume – reject – accept –

ignore - abort» User-defined policies

Page 24: Model driven exception handling in Web applications

24

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

SomepageE E E E

Handling Approach 10/11

• Handling Model for Synchronous exceptions

Resume

Page 25: Model driven exception handling in Web applications

25

Handling Approach 11/11

• Handling Model for Asynchronous exceptions

Loan Request Activity

Available Loans

Loan Details

LoanAck

Loan Search Activity

Search Criteria

Homepage WS

Somepage

Control

Exceptionpage

Resume

Reject

Page 26: Model driven exception handling in Web applications

26

Table of Contents

• Workflow-driven Web applications

• Exceptions in workflow-driven Web applications

• Handling Approach

• Implementation in WebMLExceptions

Handling Approach

Implementationin WebML

Workflow-drivenWeb applications

Page 27: Model driven exception handling in Web applications

27

Implementation in WebML 1/4

• Exception Metadata Model

Process

Name

Case

StatusStartTimeStampEndTimeStamp

Activity Type

Name

Activity Instance

Group

Name...

User

UsernamePassword...

Exception Type

Name

Exception Instance

StatusStartTimeStampEndTimeStamp

0:N

1:N

0:N

1:1

Default

0:N 1:1

ExecutedBy

0:N 1:NAssigned To

1:1 1:NPart Of

1:1 1:N

Part Of

0:N

1:1

Type

0:N

1:1

Type

0:N 1:1

Affects

0:N 1:1

Affects

Loan Request

OIDEmailEstablished Rate...

Loan Proposal

IDMax_amountMin_amountConditions...

0:1 0:N

Current Page

PageUrlStarting_Page

1:1

0:1

Current

Created

0:N

1:1

InstPayment

InstIDAmountDate

RelatedTo

0:N

0:N

1:1 1:N

Installment Plan

RateExpiration_Date...

1:1 1:N

Created

0:N

1:1

ManagedBy0:N

1:1

Country

ISO_codeDiscount_RateLastVariation ...

1:N1:1

APPLICATION MODEL

WORKFLOW AND EXCEPTION META-MODEL

StatusStartTimeStampEndTimeStamp

Page 28: Model driven exception handling in Web applications

28

Implementation in WebML 2/4

• Capturing Model

– Triggers

– Web services

Modify Discount Rate

Country

Discount Rate

Session End Create Exception

Exception Instance

Connect To Session End

ExceptionInstanceToExceptionType[Exception.Type=”Session End”]

Connect To Aff. Activity

Affects

OK OK

EVENT update the Country.Discount_Rate CONDITION trueACTION create a new Exception Instance of type 'Discount Rate'

(a)

(b)

Activity ID

Exception Instance ID

Page 29: Model driven exception handling in Web applications

29

Implementation in WebML 3/4

• Notification and Handling Model for Synchronous exceptions

– Exception-Aware link

– Predefined & User-defined policies

...

Available Loans Page

Available Loans

Installment Plan

Loan Details Page

Loan Proposal

Loan ProposalCreate Loan

Request

Loan Request

Start Activity

Loan Request

OK

Installment Plan ID

E

On Wrong Starting Page

Resume Policy

EOID

Page 30: Model driven exception handling in Web applications

30

Implementation in WebML 4/4

• Notification and Handling Model for Asynchronous exceptions

– Exception Control unit

– Exception Index unit

– Predefined & User-defined policies

Customer Home Page

ExceptionControl Unit

E

Exception Page

Session End

Activity Instance[Exception ID = “Session End”]

E

Resume Policy

Reject Policy

EOID

EOID

Page 31: Model driven exception handling in Web applications

31

Thanks!

• See the details about the WWW 2005 paper:

http://dbgroup.como.polimi.it/brambilla/node/80

... And keep in touch through my homepage and twitter account:

http://home.dei.polimi.it/mbrambil http://twitter.com/MarcoBrambi

http://www.slideshare.net/mbrambil