40
Model-based Software Engineering for/with Petri nets Behaviour Modelling (and its challenges) Ekkart Kindler

Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Model-based Software Engineeringfor/with Petri netsBehaviour Modelling (and its challenges)Ekkart Kindler

Page 2: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

2MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Motivation

Page 3: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

3MBSE f/w Petri Nets:Challenges of Behaviour Modelling

EMF/GMF Technology

:Place

:Transition

:Arc

:Transition

:Place

:Arc

:Arc

source

target source

target

targetsource

:Arcsourcetarget

:Petrinet

:Token

PlaceTransition

1 source

1 targetArc

*

PetriNet

Token*

Node

Object

model

meta model

is instance of

concrete syntax abstract syntax

Place

Transition

Arc

Token

generate aneditor

Page 4: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

4MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Benefits of Modelling (cntd.)

Better Understanding

Mapping of instances to XML syntax (XMI)

Automatic Code Generation API for creating, deleting and modifying model Methods for loading and saving models (in XMI) Standard mechanisms for keeping track of changes

(observers) Editors and GUIs

Page 5: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

5MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Table of Contents

Motivation Model-based Software Engineering Business process modelling

Challenges and Problems Some Ideas modelling behaviour integration and coordination of behaviour

Discussion

Page 6: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

6MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Example: Business Trip

note

note

trip documents receipts

application form

approval

reimburse-ment form

reimburse-ment form& receipts

copy of af

determine trip data

applyfor trip

supporttrip

booktrip

approvetrip

sendtrip form

maketrip

fill intrip form

reimburseexpenses

lecturer

lecturer

lecturerlecturer

superior dean clerk

clerk

lecturer

Page 7: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

7MBSE f/w Petri Nets:Challenges of Behaviour Modelling

“Summary”

Where does the “modelling only” idea work?

Graphical editors

Workflowmanagement

•graphics only•standard functions only

•no business logic

•standard GUI only

•business logic explicitly modelled

•dedicated modelling notation

?

Page 8: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindlere.g. a Petri net simulator?

8MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 9: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

9MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Challenges

“There are no notationsfor modelling behaviour!”

Page 10: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

10MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Challenges Adequate modelling methodologies

Coarse grain behaviour Fine grain behaviour

Mechanism for integrating and coordinating behaviour beyond invocation(calls of procedure, function, method, or service)

Integration with existing software (legacy, manually created, generated) other models (structural & behavioural)

Change mentality (change culture) Stuck with thread- and invocation-based thinking Software engineering is programming thinking

( model interpretation vs. code generation)

Page 11: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

11MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Table of Contents

Motivation Model-based Software Engineering Business process modelling

Challenges and Problems Some Ideas modelling behaviour integration and coordination of behaviour

(a vision: Event Coordination NOtation ECNO) Discussion

Page 12: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler2. The Event Coordination NOtation

Motivation Given some object oriented software with (or without)

explicit domain model,

model behaviour on top of it – and make these models executable.

Model behaviour on a high level ofabstraction (domain): coordination of behaviour

Integrate behaviour models with structural models Integrate different structural models and manually written

code (or code generated by different technologies)12MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Meta-models / domain modelsincluding behaviour!

Page 13: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

13MBSE f/w Petri Nets:Challenges of Behaviour Modelling

2.1 Example: Vending machine

Slot

Panel

Control

Coffee

Brewer

Output

*

**

*

*

*

Safe

Coin

Tea

1

Page 14: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

14MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Instance: Object Diagram

: Slot

:Panel

:Control

:Coffee

:Output: Safe

:Coin

:Tea

:Coffee

:Coin

:Coin

Page 15: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

15MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Coordination Diagram

Slot

insertreturn_passreset

Panel GUI

coffeeGUI

tea GUI

cancel GUI

Coffee

Output GUI

cup_in GUI

cup_out GUI

*

cup_in: 1

coffee: 1 tea: 1reset: ALL

coffee: 1tea: 1cancel: ALL

reset: ALLpass: 1

pass: 1

**

*

*

insert: 1

*

return_: ALLpass: 1

Safe

pass

GUICoin

insert GUI

passreturn_

Tea

Brewercoffee tearesetcup_in

1

Control

coffeeteacancelpassreset

Page 16: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

16MBSE f/w Petri Nets:Challenges of Behaviour Modelling

... + Event declaration

Slot

insertreturn_passreset

Panel GUI

coffeeGUI

tea GUI

cancel GUI

Control

coffeeteacancelpassreset

Coffee

Output GUI

cup_in GUI

cup_out GUI

*

cup_in: 1

coffee: 1 tea: 1reset: ALL

coffee: 1tea: 1cancel: ALL

reset: ALLpass: 1

pass: 1

*

**

*

insert: 1

*

return_: ALLpass: 1

Safe

pass

GUICoin

insert GUI

passreturn_

Tea

insert(Coin coin, Slot slot) coffee()pass(Coin coin, Slot slot) tea()return(Slot slot) cancel()reset_()

cup_in()cup_out()

Brewercoffee tearesetcup_in

1

Page 17: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

17MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Interaction

: Slot

:Panel

:Control

:Coffee

:Output: Safe

:Coin

:Tea

:Coffee

:Coin

:Coin

coffee

coffeecoffee

passpasspass

pass

coffee: 1

pass: 1

pass: 1

coffee: 1

coffee: 1

pass: 1

Page 18: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

18MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Interaction

: Slot

:Panel

:Control

:Coffee

:Output: Safe

:Coin

:Tea

:Coffee

:Coin

:Coin

coffee

coffeecoffee

passpasspass

pass

coffee: 1

pass: 1

pass: 1coffee: 1

pass: 1

Page 19: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

19MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Another Interaction

: Slot

:Panel

:Control

:Coffee

:Output: Safe

:Coin

:Tea

:Coffee

:Coin

:Coin

cancel reset

resetresetreset

return

return

cancel

resetreturn

reset: ALLcancel: ALL

reset: ALL

reset: ALLreset: ALL

return: ALL

return: ALL

Page 20: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

20MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Local behaviour: Coffee

Page 21: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

21MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Local behaviour: Coin

Page 22: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

22MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Local behaviour: Control

reset

cancel

coffee

pass

Page 23: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

23MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Local behaviour: Slot

reset

return

Page 24: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler

24MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Interaction

: Slot

:Panel

:Control

:Coffee

:Output: Safe

:Coin

:Tea

:Coffee

:Coin

:Coin

cancel reset

resetresetreset

return

return

cancel

resetreturn

reset: ALLcancel: ALL

reset: ALL

reset: ALLreset: ALL

return: ALL

return: ALL

Page 25: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler2.2 ECNO: Basic Concepts

ElementTypes (Classes) EventTypes with

parameters

Global Behaviour: Coordination annotations for references Event type Quantification (1 or ALL)

Local behaviour (life-cycle): ECNO nets (or something else) Event binding (with parameter assignment) Condition Action

25MBSE f/w Petri Nets:Challenges of Behaviour Modelling

insert(Coin coin, Slot slot)

Control

coffeeteacancelpassreset

Brewer

coffee tearesetcup_in

coffee: 1tea: 1reset: ALL

Page 26: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler2.3 ECNO: Advanced Concepts

ECNO with its basic concepts has some limitations, which makes modelling things in an adequate waya bit painful. ECNO has some additional concepts to make modelling more convenient. E.g.

Inheritants on events

26MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 27: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler”Nicer Vendingmachine”

27MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 28: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerBehaviour inheritance

28MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 29: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler2.4 Example 2: Petri nets

29MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Fire Transition t:for ALL incoming Arcs a:

for ONE source Place p of Arc a:find a token and remove it

for ALL outgoing arcs a:for ONE target Place p of Arc a:add a new Token

Transition t enabled:for ALL incoming Arcs a:

for ONE source Place p of Arc a:find a token

t

remove add

Page 30: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerPetri net: Abstract Syntax

30MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 31: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerExample 2: Petri nets

31MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Fire Transition t:for ALL incoming Arcs a:

for ONE source Place p of Arc a:find a token and remove it

for ALL outgoing arcs a:for ONE target Place p of Arc a:add a new Token

Transition t enabled:for ALL incoming Arcs a:

for ONE source Place p of Arc a:find a token

t

remove add

Page 32: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerECNO Semantics of PN

32MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 33: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerResult

33MBSE f/w Petri Nets:Challenges of Behaviour Modelling

t1

t2t3

t4

Page 34: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerPetri net simulator

34MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 35: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart Kindler2.5 ECNO: Summary

35MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 36: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerECNO Nets

ECNO nets and the code generator are probably the largest application of the ePNK!

36MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 37: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerBeyond Mickey Mouse

37MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 38: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerDiscussion

Models of software on higher level of abstraction concise / adequate

Domain model including semantics

Coordination! Not invocation!

Idea: Define semantics of ECNO in ECNO itself (truely ”meta”)

38MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 39: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerECNO: Focus

Software Engineers(vs. end-users)

Domain level(vs. low-level programming)

Coordination(vs. algorithmics/invocation/sequential flow)

Behaviour(vs. GUI)

39MBSE f/w Petri Nets:Challenges of Behaviour Modelling

Page 40: Model-based Software Engineering for/with Petri Netsekki/teaching/external/MBSE-PN2019/...apply for trip support trip book trip approve trip send trip form make trip fill in trip form

Ekkart KindlerComment of a non-IT friend

”Oh, that’s great. Then I can also develop my own software now.”

40MBSE f/w Petri Nets:Challenges of Behaviour Modelling