modeling and validating bpmn diagrams
DESCRIPTION
BPMN 2009 Workshop @ CEC09 conference (IEEE Conference on Commerce and enterprise Computing)TRANSCRIPT
Modeling and ValidatingBPMN Diagrams
Michele Chinosi, Alberto Trombetta
Universita degli Studi dell’Insubria (Varese – Italy)Dipartimento di Informatica e Comunicazione
BPMN 2009 WorkshopJuly 20, 2009, Vienna, Austria
Contents Cloud
2/38
Agenda
BPMN 1.1 and 2.0 Analysis
Our BPMN Metamodel Proposal
The XML Linearization
Referential Integrity
Concluding Remarks
3/38
Motivations
• need for easy usable models to test properties, to patch BPMN andto add new features
• other proposals (as well as BPMN 2.0 submissions) are quite unclearand too complex
• lack of validation support
• BPMN 1.1/1.2 comes without a native XSD
• methods to ensure diagrams correctness are manual and error-prone
4/38
Contributions
• simplified test-oriented version of the BPMN metamodel
• self-validating XML serialization for BPMN diagrams
• automated checks (using software tools)
• our approach could be abstracted from the specificities of BPMN1.2 porting the base concepts also to BPMN 2.0
Last-Month Update
This work has been partially superseded by the recent BPMN 2.0 finalsubmission adoption by OMG. We will see a brief summary of majorchanges at the end of this talk.
5/38
Contributions
• simplified test-oriented version of the BPMN metamodel
• self-validating XML serialization for BPMN diagrams
• automated checks (using software tools)
• our approach could be abstracted from the specificities of BPMN1.2 porting the base concepts also to BPMN 2.0
Last-Month Update
This work has been partially superseded by the recent BPMN 2.0 finalsubmission adoption by OMG. We will see a brief summary of majorchanges at the end of this talk.
5/38
BPMN 1.1 Weak Points Analysis
• weak hierarchical structure of the model• BPD are strongly hierarchical• elements placement inside the model does not reflect the expected
placement inside the diagram
• UML metamodel uses only generalization connections• no valid/meaningful instances
• lack of distinctions between several elements and types definitions• they are all elements (classes)• Connections-by-Types
6/38
Sketch of BPMN 1.1 Metamodel
7/38
Different Hierarchical Structures Comparison
8/38
BPMN 2.0 Overview
(B)IOS
• (BEA), IBM, Oracle, SAP
• execution semantics formalization
• extensibility mechanism for both model and graphical extensions
• event composition and correlation refinement
• human interactions definition
• choreography model
BPMN-S
• Adaptive, Axway Software, HP, Lombardi Software, Fujitsu, et al.
• business level modeling
• checking compliance to choreography and rules
• process taxonomies
• execution interoperability
• model re-usability
9/38
Sketch of BPMN 2.0 UML – (B)IOS Proposal
10/38
Sketch of BPMN 2.0 UML – BPMN-S Proposal
11/38
Sketch of BPMN 2.0 UML – Final Submission
12/38
BPMN 2.0 – The CORE UML Class Diagram Example
13/38
BPMN 2.0 – The Package Diagram Example
14/38
Our BPMN 1.1 Metamodel Proposal
• top-down fashion methodology• from BPD to all the other elements• strongly hierarchical model
• reduces the Connections-by-Types and deletes all the missingconnections
• BPMN Supporting elements treated as types• simpler model• Connections-by-Semantics (UML compositions)
• every BPD can be described as one valid instance of the model
• right positioning of Connecting flow objects
15/38
Sketch of our BPMN 1.1 Metamodel Proposal
16/38
The XML Linearization
BPMN ⊃ WS-BPEL Still incomplete⇒ BPMN 2.0 ⇒ and
BPMN 6= XPDL Complex
BPMN 1.1 → XMLcould be adapted to become−−−−−−−−−−−−−−−−−−−−−→ ⊆ BPMN 2.0
• Our linearization proposal could be useful to study diagram and/ormodel properties and to make some tests, as well as to validate botha model and its instances.
17/38
The XML Linearization
BPMN ⊃ WS-BPEL Still incomplete⇒ BPMN 2.0 ⇒ and
BPMN 6= XPDL Complex
BPMN 1.1 → XMLcould be adapted to become−−−−−−−−−−−−−−−−−−−−−→ ⊆ BPMN 2.0
• Our linearization proposal could be useful to study diagram and/ormodel properties and to make some tests, as well as to validate botha model and its instances.
17/38
Detailed BPMN 1.1 Weak Points Analysis
Attributes default values
• BPMN defines mandatory attributes WITH default values
• XML-Schema does not permit this double assertion
. if an attribute has the default clause defined, it takes the defaultvalue even if it is not present at all
. use=‘‘optional’’ + default=...
Process
• BPMN defines Processes as conceptual siblings of the BPD
• if a Pool shares a Process, then it has one or more Lanes
• all the other elements are referenced by the Process using their IDs
!! we don’t want a valid instance with Process as root element
. ∃ Process ⇒ ∃ Pool, but ∃ Pool ; ∃ Process
. Process becomes child of Pool
18/38
Detailed BPMN 1.1 Weak Points Analysis
Attributes default values
• BPMN defines mandatory attributes WITH default values
• XML-Schema does not permit this double assertion
. if an attribute has the default clause defined, it takes the defaultvalue even if it is not present at all
. use=‘‘optional’’ + default=...
Process
• BPMN defines Processes as conceptual siblings of the BPD
• if a Pool shares a Process, then it has one or more Lanes
• all the other elements are referenced by the Process using their IDs
!! we don’t want a valid instance with Process as root element
. ∃ Process ⇒ ∃ Pool, but ∃ Pool ; ∃ Process
. Process becomes child of Pool
18/38
Detailed BPMN 1.1 Weak Points Analysis
Attributes default values
• BPMN defines mandatory attributes WITH default values
• XML-Schema does not permit this double assertion
. if an attribute has the default clause defined, it takes the defaultvalue even if it is not present at all
. use=‘‘optional’’ + default=...
Process
• BPMN defines Processes as conceptual siblings of the BPD
• if a Pool shares a Process, then it has one or more Lanes
• all the other elements are referenced by the Process using their IDs
!! we don’t want a valid instance with Process as root element
. ∃ Process ⇒ ∃ Pool, but ∃ Pool ; ∃ Process
. Process becomes child of Pool
18/38
Detailed BPMN 1.1 Weak Points Analysis
Attributes default values
• BPMN defines mandatory attributes WITH default values
• XML-Schema does not permit this double assertion
. if an attribute has the default clause defined, it takes the defaultvalue even if it is not present at all
. use=‘‘optional’’ + default=...
Process
• BPMN defines Processes as conceptual siblings of the BPD
• if a Pool shares a Process, then it has one or more Lanes
• all the other elements are referenced by the Process using their IDs
!! we don’t want a valid instance with Process as root element
. ∃ Process ⇒ ∃ Pool, but ∃ Pool ; ∃ Process
. Process becomes child of Pool
18/38
Detailed BPMN 1.1 Weak Points Analysis
Participant
• “A Pool represents a Participant”
. Participant is child of Pool
Message
• “A Message is the object that is transmitted through aMessageFlow”
. Message is child of MessageFlow
19/38
Detailed BPMN 1.1 Weak Points Analysis
Participant
• “A Pool represents a Participant”
. Participant is child of Pool
Message
• “A Message is the object that is transmitted through aMessageFlow”
. Message is child of MessageFlow
19/38
Detailed BPMN 1.1 Weak Points Analysis
Web Service
• WebService is required by many other elements
• BPMN defines WebService as a Supporting Element
. Inside the BPMN to WS-BPEL mapping example the WebService isdefined inside the parent element
. We chose to instantiate WebService every time it is needed(xs:assert)
20/38
Send Task Definition
1<xs:complexType name="SendTaskType">2<xs:complexContent >3<xs:extension base="bpex:TaskType">4<xs:sequence >5<xs:element name="WebService"6type="bpex:WebServiceType" minOccurs="0">7<xs:assert test="@Implementation=‘Web Service ’"/>8</xs:element >9</xs:sequence >10<xs:attribute name="MessageRef"11type="bpex:ObjectRef" use="required"/>12<xs:attribute name="Implementation"13default="Web Service">14<xs:simpleType >15...
Listing 1: An excerpt of the Send Task definition
21/38
Detailed BPMN 1.1 Weak Points Analysis
Events
• XPDL and WS-BPEL define for each Event type a different element
• complex XML tree
• BPMN defines only one Event ELEMENT with 3 FAMILIES andmany different TYPES
. families and types are specifications and not different elementdefinitions
. Start, Intermediate and End Event are children of Lane(xs:assert)
. we assign a different type based on the Trigger or Resultattributes values (xs:alternative)
22/38
Event Definition
1<xs:complexType name="LaneType">2<xs:complexContent >3<xs:extension base="bpex:CommonSwimlaneType">4<xs:sequence >5<xs:element name="StartEvent"6type="bpex:StartEventType"7minOccurs="0" maxOccurs="unbounded">8<xs:assert test="@EventType=’Start ’"/>9</xs:element >10...11<xs:complexType name="StartEventType">12<xs:complexContent >13<xs:extension base="bpex:EventType">14<xs:sequence >15<xs:element name="Trigger"16type="bpex:CommonEventDetailType"17minOccurs="0" maxOccurs="unbounded">18<xs:alternative test="@EventDetailType=’None ’"19type="bpex:NoneEventDetailType"/>20<xs:alternative test="@EventDetailType=’Message ’"21type="bpex:MessageEventDetailType"/>22...
Listing 2: An excerpt of the Events definition
23/38
Detailed BPMN 1.1 Weak Points Analysis
Gateways
• Gateways can only be detailed in one of the five provided types
• there is only one element (Gateway) and five possible specifications
• the Gateway default type is chosen in 2 steps: Exclusive and thenData-Based
. we define only one element of type Gateway, child of Lane
. we decide in a second time the Gateway type usingxs:alternative
. the Gateway default type is chosen in 1 single step: Data-BasedExclusive
24/38
Gateway Definition
1<xs:element name="Gateway" type="bpex:CommonGatewayType"2minOccurs="0" maxOccurs="unbounded">3<xs:alternative4test="@GatewayType=’Data -Based Exclusive ’"5type="bpex:DataBasedExclusiveGatewayType"/>6<xs:alternative7test="@GatewayType=’Event -Based Exclusive ’"8type="bpex:EventBasedExclusiveGatewayType"/>9<xs:alternative10test="@GatewayType=’Inclusive ’"11type="bpex:InclusiveGatewayType"/>12...
Listing 3: An excerpt of the Gateways definition
25/38
Detailed BPMN 1.1 Weak Points Analysis
Sub-Processes
• Reusable: Activity which re-calls another Process. ProcessRef and DiagramRef
• Reference: it points to another already defined Sub-Process. SubProcessRef
• Embedded: it contains a process dependent from the parent process. the SubProcess elements are defined as Lane children andreferenced using the GraphicalElements attribute
26/38
Detailed BPMN 1.1 Weak Points Analysis
Artifacts
• one Artifact could be used across the whole BPD, using Associationsto reference elements
• they need only one place to be instantiated
. Artifacts as BPD children
. inside the XML they can be positioned everywhere
Transactions and Signals
• some elements need to be referenced from multiple objects and theyare instantiated every time they are requested: different IDs but thesame name
• the attribute TransactionId of type String serves as an “identifierfor the Transactions used within a diagram”
. we extended the idea behind the TransactionId also to Signalsand other similar objects
27/38
Detailed BPMN 1.1 Weak Points Analysis
Artifacts
• one Artifact could be used across the whole BPD, using Associationsto reference elements
• they need only one place to be instantiated
. Artifacts as BPD children
. inside the XML they can be positioned everywhere
Transactions and Signals
• some elements need to be referenced from multiple objects and theyare instantiated every time they are requested: different IDs but thesame name
• the attribute TransactionId of type String serves as an “identifierfor the Transactions used within a diagram”
. we extended the idea behind the TransactionId also to Signalsand other similar objects
27/38
Referential Integrity Using XPath
• The very old way: manual ID/IDRef references – strings, numbers,NCNames, random generators, . . .
• The old way: xs:key and xs:keyref
• The new way: xs:assert and xs:alternative
xs:assert
• <xs:assert-test=‘‘XPathExpr’’ />
• limit: the XPath 2.0 expressions set
xs:alternative
• it permits to choose the type of an element according to the successof a XPath 2.0 test
• useful for Events, Gateways, Activities
28/38
Referential Integrity Using XPath
• The very old way: manual ID/IDRef references – strings, numbers,NCNames, random generators, . . .
• The old way: xs:key and xs:keyref
• The new way: xs:assert and xs:alternative
xs:assert
• <xs:assert-test=‘‘XPathExpr’’ />
• limit: the XPath 2.0 expressions set
xs:alternative
• it permits to choose the type of an element according to the successof a XPath 2.0 test
• useful for Events, Gateways, Activities
28/38
Referential Integrity Verification
• Using our XML-Schema Model we are able to validate statically thesyntax as well as structural semantics rules of a BPD
• Using a set of XQuery/XPath interrogations on the XML instanceswe can validate also most of the behavioral semantics rules of BPMN
• The use of XQuery/XPath let us verify business rules at code-gentime and at run-time
29/38
Wrong BPMN Diagram
red: clear (model) errors – orange: hidden (XML) errors
30/38
Parsing the XML Document
31/38
Start Event Check
1for $pool in //Pool ,2$startevent in $pool// StartEvent3return $pool// SequenceFlow[@bpex:TargetRef= ←↩4$startevent/@bpex:Id ]/ @bpex:Id
Listing 4: Rules verification using XPath/XQuery: Start Event
32/38
Events Number Check
1for $pool in //Pool ,2$numSE in count ($pool// StartEvent),3$numEE in count ($pool// EndEvent)4return if ($numSE >0) then5if ($numEE >0) then true() else false()6else7if ($numEE =0) then true() else false()
Listing 5: Rules verification using XPath/XQuery: Events number
“If there is an End (Start) Event, then there MUST be at least one Start(End) Event”
33/38
Instantiation Semantic Verification
1for $pool in //Pool ,2$startEvent in $pool//StartEvent ,3$numSE in count ($ startEvent),4$elements in $pool/Lane /*[ name ()!="StartEvent"]5return6if ($numSE >0) then7if (every $id in $elements/@bpex:Id satisfies ←↩8$id=$pool/SequenceFlow/@bpex:TargetRef)9then true()10else $elements/@bpex:Id11else false()
Listing 6: Rules verification using XPath/XQuery: instantiation semantic
“If the Start Event is used, then there MUST NOT be other flowelements that do not have incoming Sequence Flow”
34/38
Comparison with BPMN 2.0
BPMN 1.1/1.2 BPMN 2.0 Could our proposal bestill valid?
Metamodel Y Y With some changes tobe compliant to theBPMN 2.0 metamodel
XSD N Y With some changesReferential Int. Partially Partially YExecution N Y Y
To have a simplified core subset of both the BPMN metamodel and theXML-Schema, compliant to BPMN specifications, is useful to test someproperties, to implement new features, to attempt new strategies, toimplement patches.
35/38
Conclusions
What we have talked about
. BPMN 1.1 analysis
. BPMN 2.0 metamodel overview
. Our proposal for a BPMN simplified test-oriented metamodel
. Our proposal for a BPMN XML serialization
. Referential Integrity in BPMN: overview and new approach
. Differences between BPMN 1.1 and BPMN 2.0
36/38
Further Works
. We are deeply analyzing both the BPMN 2.0 metamodel and its XSDto get some weaknesses
. We aim to build a tough core subset of the BPMN 2.0 metamodelderiving, as a consequence, a core subset of the XML-Schemaserialization
. We aim to test some properties over this BPMN Core (maybe the sameCore as defined inside BPMN 2.0 specs) adding some new functionalitieslike the validation support at code-gen time.
37/38
Thank you.
Questions?
July 20, 1969 – 22.56 EDT
38/38