p03_bpmntoorm.pdf

39
Mapping BPMN process models to data models in ORM H. Balsters September 2013 Process-driven database design

Upload: anupong-hutawarakorn

Post on 12-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: p03_BPMNtoORM.pdf

Mapping BPMN process models to data models in ORM

H. BalstersSeptember 2013

Process-driven database design

Page 2: p03_BPMNtoORM.pdf

Integrating data and processes (1)

Business data is data inside databasesBusiness processes define the workflow dependencies inside an organization

Page 3: p03_BPMNtoORM.pdf

Integrating data and processes (2)

In organizations, operational environments are increasingly permeated with ITRequirements w.r.t. size and quality of data concerning modern products, services and control, are managed using automatic supportIn our case, this automatic support is offered by database-driven control systems

Page 4: p03_BPMNtoORM.pdf

Integrating data and processes (3)

IT (in our case, properly designed databases) can take care of collecting data that can guarantee data quality

Business processes drive people and organizations, and use data to function properly

Page 5: p03_BPMNtoORM.pdf

Integrating data and processes (4)

The actions in processes need decisions based on input data. and (external) constraints

The actions also result in output data, at the very least data describing what exactly happened

It is often necessary to check that the action was executed correctly: input and output data "match".

Separate processes are performed in a certain order, to realize the eventual business process: a workflow

Workflow systems and database systems work together to realize the complete business process

Page 6: p03_BPMNtoORM.pdf

Integrating processes with data

Total Quality Management: Integrating data and processes, understanding, validating, and evaluating complete business processes from beginning to end

Process-driven database design: How do we get data in sync with our processes?

Page 7: p03_BPMNtoORM.pdf

Things that need fixing

Common practice 1: there is a business process (e.g., some manager’s flowchart), but no systematic link to a database

Common practice 2: there is business data (e.g., some manager’s spread sheet), but no systematic link to a business process

Page 8: p03_BPMNtoORM.pdf

Process-driven database design

Model a business process from the perspective of anend-user of the database

Such a business process is called a data-use process(a DUP)

Each (data-)stakeholder in the business process has its own DUP

Derive a (complete and minimal) data model thatfits each DUP

Page 9: p03_BPMNtoORM.pdf

How do we synchronize the business process with the business data?

BPMN, followed by ORM ..

Making Business Process Models using Business Process Modelling Notation (BPMN)

Making Business Data Models using Object Role Modeling (ORM)

The ORM models are derived from the BPMN/DUP-models

Page 10: p03_BPMNtoORM.pdf

ORM/SQL results in the grand finale: the full system database

From ORM, we generate complete relational databases (business data)

Imperative SQL (stored functions and –procedures) , e.g., could implement our business processes in terms of high-level database transactions

This is how we eventually arrive at the big picture of what enterprise/organization data should/could look like

Page 11: p03_BPMNtoORM.pdf

Why BPMN?

International standard (OMG: Object Management Group)

Process language for Business Applications Large set of process primitives Core subset is easy to read and write Good tooling widely available Maps nicely to ORM (as we shall see later)

Page 12: p03_BPMNtoORM.pdf

Our example: The Thermostat

Representative of many typical technical (but also business!) processes

Airplane flight control: Homeostat Quality control in production process Quality control in administrative organizations Often, large amounts of data Data is highly structured and is heavily tied to constraints All transaction details can be logged (e.g. for

auditing/troubleshooting purposes) Hence, by logging, a process trace automatically involves

data!

Page 13: p03_BPMNtoORM.pdf

Consider as the end user/stakeholder: quality controller of a heating system

Consider the kind of questions such a q.c. would want to pose to a database containing information about the heating system

We will model the process underlying the heating system (how the system works as far as it is relevant for the q.c.): construct a DUP for the q.c. wrt the heating system

Subsequently we will derive the data relevant to that DUP

Page 14: p03_BPMNtoORM.pdf

Heating system using a thermostat

Page 15: p03_BPMNtoORM.pdf

•BPMN-task 1: <Set Temperature>

General pattern is:<Verb-phrase present tense Noun-phrase>

This yields:

• ORM-event 1: [Temperature Setting: is logged]

General pattern is: [Noun-phrase (Verb-phrase objectified): is logged]

Page 16: p03_BPMNtoORM.pdf

• We note that we use the word “event” as it is used in database terminology; i.e., in a CRUD sense

• In the event [Temperature Setting: is logged], “is logged” refers to the time stamping of that event

• A structure of an event is offered by a data model fragment capturing the occurrence of an activity at a certain instant in time

Page 17: p03_BPMNtoORM.pdf

We are attempting to find a (minimal) set of fact types offering the “data need” for an activity inside some business process (cf. Tony Morgan, BBB, 2008)

Page 18: p03_BPMNtoORM.pdf

We guide the construction of a data model fragment (in this case pertaining to the event TempSetting, by asking the following (not necessarily complete) set of general fact-type identification questions against the task in question:

1. Which entities are involved in the event as participants?2. At what instant (timestamp) does the event happen?3. How do we identify the event?4. What do we have as input for the event?5. What do we have as output of the event?

(Of course, answering such a set of questions, will -in general- often need the support of domain expert knowledge.)

Page 19: p03_BPMNtoORM.pdf

Minimal ORM model underlying this task:

Page 20: p03_BPMNtoORM.pdf

The desired ORM-event is realized by the following SQL-instruction:

Insert into TempSetting values (tempSettingNr, instant, thermostatNr, targetTemperature)

applied to the TempSetting table

Page 21: p03_BPMNtoORM.pdf

BPMN-task 2: <Measure Temperature>, is associated to

ORM-event 2: [Temperature Measurement: is logged]

Applying the same fact-type identification method, we obtain the following ORM model fragment

Page 22: p03_BPMNtoORM.pdf

We note that we also need a rule (written here in OLE: ORM-Logic driven English [Balsters 2012]) indicating that a temperature measurement event is preceded (in time) by a temperature setting event

for each TempSetting, TempMeasurement, Instant1, and Instant2: if that TempMeasurement involves that TempSetting andthat TempSetting is at that Instant1 andthat TempMeasurement is at that Instant2 then that Instant1<that Instant2.

Page 23: p03_BPMNtoORM.pdf

In SQL:

Insert into TempMeasurement values (tempMeasurementNr, instant, tempSettingNr, currentTemperature)

Page 24: p03_BPMNtoORM.pdf

BPMN-task 3: <Compare temperature>, results in

ORM-event 3: [Temperature Comparison: is derived and logged]

BPMN-control 1: Query-fork after <Compare Temperature>, results in ORM-event 4: [Temp(erature Comparison results in )OK]

Page 25: p03_BPMNtoORM.pdf

Minimal ORM model

Page 26: p03_BPMNtoORM.pdf

• A temperature value will be called ‘OK’, exactly when the measured temperature is equal to or higher than the temperature value that has been set. Otherwise the temperature value is called ‘too low’

• In the case that the temperature value is ‘OK’, the system moves on to the next temperature measurement

These derivation rules ( written in OLE) are offered by

for each TempComparison: that TempComparison results in some TempOK, exactly whenthe Temperature of the TempMeasurement of that TempComparisonis equal to or higher thanthe Temperature of (the TempSetting of the TempMeasurement of that TempComparison)

Page 27: p03_BPMNtoORM.pdf

The database has evolved into:

Page 28: p03_BPMNtoORM.pdf

Alternative: Modeling temperature comparison using derivations only*

* ackn. to Terry Halpin

Page 29: p03_BPMNtoORM.pdf

BPMN-ORM procedure: What have we been doing?

1. Create BPMN-task and specify the associated ORM event2. Find the minimal model that realizes the desired ORM

event using our fact-type identification method3. Create next BPMN-task4. Transform that task into a subsequent ORM event5. Find the minimal extension to the previous ORM model

fragment that defines that subsequent ORM event6. Repeat 1-5 until all events for all data-stakeholders are

finished7. At the end you will have created the complete corporate

database, associated to the original business process

Page 30: p03_BPMNtoORM.pdf

General rules for transforming BPMN models to ORM models

Consider a simple (but generally structured) process model

Page 31: p03_BPMNtoORM.pdf

The Start event is transformed into

Page 32: p03_BPMNtoORM.pdf

The sequence flow of activity <Do Event1> followed by <Do Event2> is transformed into

Page 33: p03_BPMNtoORM.pdf

We note that we also need a rule to indicate that Event2is preceded (in time) by Event1 (written here in OLE)

for each Event1, Event2, Instant1, and Instant2: if that Event1 has successor that Event2 andthat Event1 is at that Instant1 and that Event2 is at that Instant2 then that Instant1<that Instant2

Page 34: p03_BPMNtoORM.pdf

Activity <Do Event2> is followed by a gateway (in this case an exclusive-or fork) resulting in a divergence of two activities followed by an exclusive gateway, which is transformed into

Page 35: p03_BPMNtoORM.pdf

Usually, the two fact types

Event2Check results in Event2CheckOK

Event2Check results in Event2CheckNot-OK

are derived

Page 36: p03_BPMNtoORM.pdf

An alternative to modeling temperature comparison using derivations only

Page 37: p03_BPMNtoORM.pdf

The exclusive-or gateway results in a divergence of two activities <Do Event3> and <Do Event4>, after which the process stops; this results in the following transformation into an ORM model

Page 38: p03_BPMNtoORM.pdf

We also need an extra constraint stating that if Event2 is followed by Event3, then Event3 is followed by some Stop event (and an analogous rule in the case that Event2 is followed by Event4). We can state this (in OLE) as follows

for each Event2 and Event3: if that Event2 is followed by that Event3 then that Event3 is followed by some Stop

We note that an inclusive-or gateway in the process model (replacing the exclusive-or gateway) would result in deleting the exclusion constraint in the ORM model

Page 39: p03_BPMNtoORM.pdf

Remaining work

1.A general mapping of the meta-model of a (yet to-be defined) core of BPMN to the meta-model of FBM2.This core is to be database-specific

Tooling (α-versions complete)

1.BPMN to OLE (interactive dialogue tool)2.OLE to SQL (compiler)