Top Banner
Keith D Swenson May 2015 @swensonkeith Robustness in Process http:// www.slideshare.net / kswenson / mribp2015
70
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: mri-bp2015

Keith D Swenson

May 2015

@swensonkeith

Robustness in Process

http:// www.slideshare.net / kswenson / mribp2015

Page 2: mri-bp2015

1. Coding Effect on Robustness

2. Process and Transactions

3.Transactions and Messages

4. Distributed Scenarios

5. Etiquette

Page 3: mri-bp2015

APPLICATION

DISK SPACE ….

Page 4: mri-bp2015

The Day the Application Stood Still

Application built and deployed

Works fine with some number of people, say 50

CPU is around 2%

Memory and disk IO is reasonable

Above that number of people

CPU spikes to ~90%

Users complain of frozen screens

Disk IO and memory usage spike

Becomes impossible to do the simplest tasks

What is going on?

Page 5: mri-bp2015

The Beast

...

try {

InitialContext cxt = new InitialContext();

String dataSourceJndi = mapComponentSettings.get("AssocDataSource");

DataSource ds = (DataSource) cxt.lookup(dataSourceJndi);

privateAssociations.setDataSource(ds);

}

catch (Exception e) {

log.error("Unable to load JNDI data source from context.");

}

...

Page 6: mri-bp2015

Don’t Swallow

Exceptions

Page 7: mri-bp2015

...

try {

InitialContext cxt = new InitialContext();

String dataSourceJndi = mapComponentSettings.get("AssocDataSource");

DataSource ds = (DataSource) cxt.lookup(dataSourceJndi);

privateAssociations.setDataSource(ds);

}

catch (Exception e) {

log.error("Unable to load JNDI data source: " + e.toString());

return null;

}

...

Page 8: mri-bp2015

Don’t Swallow

Exceptions You Don’t Know

what the

Exception will be!

ADD the

Current

Context

& RETHROW

Don’t Log

IT!

Callers

Don’t test

For NULL

Page 9: mri-bp2015

Normal

Situation

Error

Situation

Error

Situation

Error

Situation

cond

ition

condition

conditio

n

Page 10: mri-bp2015
Page 11: mri-bp2015

Started at Netscape in 1990’s

Input to Java team

Informed by projects from iFlow

and Interstage BPM in 2000’s

While the purpose of error

reporting is to assist in solving

the problem.

There is a problem

The system can’t handle it

The more completely the problem is

described, the faster it is resolved,

the happier users will be.

Page 12: mri-bp2015

Throwing an exception should never be used to return a "normal" value

back to the caller.

Describe the current scope! Not what you think caused the exception.

Use a single monomorphic exception class.

• Every method (that throws) should declare throwing java.lang.Exception.

• Every catch block should catch java.lang.Exception

Do not assume that there is only one possible exception to be caught.

Always test for the exact exception class and the exact message key

before handling the exception in any other way than wrap and re-throw.

Don’t worry about making catch blocks efficient. Instead, design them to

be easy to maintain and easy to verify that the exception correctly

handled.

Act as if LOG files are not accessible

Page 13: mri-bp2015

https://agiletribe.wordpress.com/

Page 14: mri-bp2015

TRANSACTIONS

Page 15: mri-bp2015

3GL Code

Data Sources

Page 16: mri-bp2015

Resting state Transaction

Occurs

Resting state

Page 17: mri-bp2015

A transition is a transaction

Transaction

Data Sources

Page 18: mri-bp2015

Transaction Rollback … User View

Transaction

Rollback

Data Sources

Fail

Page 19: mri-bp2015

Data Sources

Error State

Resting state

(error mode)

Transaction 1 Fail

Rollback

Transaction

2

Page 20: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 21: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 22: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 23: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 24: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 25: mri-bp2015

Subprocess Scenario

Parent Process Child Process

Page 26: mri-bp2015

Retries are Evil

Retries!

Data Sources

Page 27: mri-bp2015

BPMN Transactional Notation

Page 28: mri-bp2015
Page 29: mri-bp2015

Transaction 1

Transaction 2

Page 30: mri-bp2015

A Single

Transaction

Any failure in

either node,

you roll back to

where you started,

and put the process

in error mode.

Page 31: mri-bp2015
Page 32: mri-bp2015

What does this mean?

A BPMN transaction boundary

Page 33: mri-bp2015

Something like

this might make

more sense …

but not really.

Page 34: mri-bp2015
Page 35: mri-bp2015

Front

1

2 3

Unit 1 Unit 2

Unit 3

4

5

6

Message

Bus

Page 36: mri-bp2015

Front

Unit 1 Unit 2

Unit 3

Unit 5

Unit 4

Message

Bus

Page 37: mri-bp2015

Fire and Forget

Front

Unit 1 Unit 2

Unit 3

Unit 5

Unit 4

Fail

Message

Bus

Page 38: mri-bp2015

HOWEVER…

Page 39: mri-bp2015

Distributed Systems

One transactionally

consistent enclave Another transactionally

consistent enclave

You have to deal with the fact that you can not have

transactional consistency everywhere

Page 40: mri-bp2015

Business Process != System Architecture

Page 41: mri-bp2015

Business Process != System Architecture

Page 42: mri-bp2015

Required configuration in 6 different environments to be

consistent.

If one got our of sync, it broke the processes.

Messages were assumed to be reliable, but between reliable

system, they can NOT be reliable.

Your protocol MUST assume that messages are reliable, and

must deal with that.

Page 43: mri-bp2015

Gringo Symposium Process

Reserve Room

Invite Speaker

Order Drinks

Page 44: mri-bp2015

Gringo Symposium Process

Order Drinks

Order Fulfillment

A

B

Infinite Liquors A reliable message

Transport with

“exactly once”

delivery

“Six cases of

Sierra Nevada

Pale Ale for

delivery.”

2:07 PM 2:07 PM

Page 45: mri-bp2015

Gringo Symposium Process

Order Drinks

Order Fulfillment

A

B

Infinite Liquors

Disk

Crash

2:10 PM

Page 46: mri-bp2015

Gringo Symposium Process

Order Drinks

Order Fulfillment

A

B

Infinite Liquors

2:30 PM

1:00 PM

Backup

2:30 PM

Page 47: mri-bp2015

Reliable System

#1

Reliable System

#2

Always

Consistent

Always

Consistent

Page 48: mri-bp2015

Reliable System

#1a

Reliable System

#1c

Always

Consistent?

#1b

Page 49: mri-bp2015

Consistency Seeking

Gringo Symposium

Order Drinks

Order Fulfillment

A

B

Infinite Liquors Orders

FOR

Infinite

Liquors

Orders

FROM

Gringo

Compare.

Are these

Consistent?

Take action

To make

Consistent.

Hourly

Poll.

Page 50: mri-bp2015

Ship Bridge

to Engine Room

telegraph

use the same

principle

Page 51: mri-bp2015

BPM

Page 52: mri-bp2015

Roles, and Etiquette

Purchasing Agent Product Development

Page 53: mri-bp2015
Page 54: mri-bp2015
Page 55: mri-bp2015

Business Etiquette Modeling

For each role in an organization, determine:

each of the services that role might perform

what must be provided

what will be produced

what conditions will decide whether the task is accepted or not

what contexts all this is valid in

Use simulation across many roles in the organization to see if

the process is ‘optimal’

tweak the etiquette rules as necessary

Record history and track KPIs like normal

Respond if necessary by tweaking the etiquette rules

Page 56: mri-bp2015
Page 57: mri-bp2015
Page 58: mri-bp2015
Page 59: mri-bp2015

Cross Company Emergent Processes

Manufacturing Company Consulting Firm

Page 60: mri-bp2015

1. Coding Effect on Robustness

2. Process and Transactions

3.Transactions and Messages

4. Distributed Scenarios

5. Etiquette

Page 61: mri-bp2015

Workflow Management Coalition

• Standards • Books • Awards • Information

Page 62: mri-bp2015

Four years running. Four books

Real-life use cases.

Experience with ACM.

http://AdaptiveCaseManagement.org/

Workflow Management Coalition

2014: Thriving on Adaptability:

Best practices

for knowledge workers

Page 63: mri-bp2015

NEW! When Thinking Matters in the Workplace: How Executives and Leaders of Knowledge Work Teams can Innovate with Case Management. http:// ThinkingMattersBook.com

Page 64: mri-bp2015

Q & A

http:// www.slideshare.net / kswenson / mribp2015

Page 65: mri-bp2015

Antifragility

http:// www.slideshare.net / kswenson / bpm2014 46:00

Page 66: mri-bp2015

We know what fragility is.

But what is the opposite?

Fragile

Page 67: mri-bp2015

?

Fragile Robust

Page 68: mri-bp2015

Fragile Robust Antifragile

Page 69: mri-bp2015

Definition of BPM

Business Process Management (BPM) is a

discipline involving any combination of

modeling, automation, execution,

control, measurement and optimization

of business activity flows,

in support of enterprise goals,

spanning systems, employees, customers and partners

within and beyond the enterprise boundaries.

Page 70: mri-bp2015

“The System”

Your

Organization

IT

System

&

People

Offices

Agreements

Skills Expertise

Relationships

Hardware

Software

Data

Desire to

optimize

the entire

system