Post on 12-Dec-2015
transcript
Mapping BPMN process models to data models in ORM
H. BalstersSeptember 2013
Process-driven database design
Integrating data and processes (1)
Business data is data inside databasesBusiness processes define the workflow dependencies inside an organization
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
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
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
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?
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
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
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
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
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)
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!
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
Heating system using a thermostat
•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]
• 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
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)
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.)
Minimal ORM model underlying this task:
The desired ORM-event is realized by the following SQL-instruction:
Insert into TempSetting values (tempSettingNr, instant, thermostatNr, targetTemperature)
applied to the TempSetting table
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
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.
In SQL:
Insert into TempMeasurement values (tempMeasurementNr, instant, tempSettingNr, currentTemperature)
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]
Minimal ORM model
• 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)
The database has evolved into:
Alternative: Modeling temperature comparison using derivations only*
* ackn. to Terry Halpin
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
General rules for transforming BPMN models to ORM models
Consider a simple (but generally structured) process model
The Start event is transformed into
The sequence flow of activity <Do Event1> followed by <Do Event2> is transformed into
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
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
Usually, the two fact types
Event2Check results in Event2CheckOK
Event2Check results in Event2CheckNot-OK
are derived
An alternative to modeling temperature comparison using derivations only
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
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
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)