1st Analysis of Model Transformations Workshop, 2012
Several important tasks performed by model driven development tools — such as well-formedness constraint validation or model transformations — rely on evaluating model queries. If the model changes rapidly or frequently, it is beneficial to provide live queries that automatically propagate these model changes into the query results. To ease the development and debugging of live queries, the development environment should provide a way to evaluate the query results continuously, helping to understand how the created query works.
This presentation presents a generic live model query visualizer that displays and updates the query results depending on their source models. It has been implemented for the EMF-IncQuery framework and presented here for validating BPMN models.
Axa Assurance Maroc - Insurer Innovation Award 2024
Developing and Visualizing Live Model Queries
1. Developing
and
Visualizing
Live
Model
Queries
Zoltán
Ujhelyi,
Tamás
Szabó
István
Ráth,
Dániel Varró
Ábel
Hegedüs
(demonstrator)
Budapest University of Technology and Economics
Department of Measurement and Informa<on Systems
2. What
is
a
Model
Query?
ModelQuery(A,B)
Cond(A,B)
o Retrieve
tuples
of
model
elements
A,B
o SaOsfying
the
query
condiOon
Cond
o Enumerate
one
/
all
instances
o With
A,B
as
input
or
output
parameters
2
3. What
is
a
Model
Query?
ModelQuery(A,B)
AUTOSAR
Cond(A,B)
• Select pairs of SystemSignal
and
o Retrieve
tuples
of
its signal group which are not in
the same IPDU
model
elements
A,B
o SaOsfying
the
query
condiOon
Cond
IMA
• Find instances of cri;cal func;ons
o Enumerate
not running on different
one
/
all
instances
processors of different chassis
o With
A,B
as
input
or
output
BPMN
parameters
• Show sink ac;vi;es with no
outgoing flow
3
4. What
is
a
Model
Query?
ModelQuery(A,B)
AUTOSAR
Cond(A,B)
• Select pairs of SystemSignal
and
o Retrieve
tuples
of
its signal group which are not in
the same IPDU
model
elements
A,B
o SaOsfying
the
query
condiOon
Cond
IMA
• Find instances of cri;cal func;ons
o Enumerate
not running on different
one
/
all
instances
processors of different chassis
o With
A,B
as
input
or
output
BPMN
parameters
• Show sink ac;vi;es with no
outgoing flow
4
5. Live
Model
Queries
Live
Query
EvaluaOon:
Incremental
cache
of
matches
o Maintain
a
cheap
cache
(only
memory
overhead)
o NoOfy
about
relevant
changes
o Enable
reacOons
to
complex
structural
events
5
6. Live
Model
Queries
Live
Query
EvaluaOon:
Incremental
cache
of
matches
o Maintain
a
cheap
cache
(only
memory
overhead)
o NoOfy
about
relevant
changes
o Enable
reacOons
to
complex
structural
events
6
7. Live
Model
Queries
Live
Query
EvaluaOon:
Incremental
cache
of
matches
o Maintain
a
cheap
cache
(only
memory
overhead)
o NoOfy
about
relevant
changes
o Enable
reacOons
to
complex
structural
events
7
8. Live
Model
Queries
Live
Query
EvaluaOon:
Live
Model
Queries
for
Model
TransformaOons
Incremental
cache
of
matches
o Maintain
a
cheap
cache
• Find
all
contexts
a
MT
rule
is
applicable
for
(only
memory
overhead)
• Live
MT
rules:
triggered
o NoOfy
about
relevant
changes
automaOcally
upon
change
o Enable
reacOons
to
complex
structural
events
Live
Model
Queries
for
Early
ValidaOon
• Find
all
violaOons
of
a
well-‐formedness
constraint
• Immediate
re-‐validaOon
upon
model
change
Live
Model
Queries
for
Traceability
Management
• See
talk
tomorrow
at
11:30
8
9. Example:
ValidaOon
of
BPMN
Models
BPMN
models
o Describing
business
processes
o Models
control
and
dataflow
• Flowchart-‐like
notaOon
9
10. Example:
ValidaOon
of
BPMN
Models
Well-‐formedness
validaOon
during
ediOng
o Sink
AcOvity:
acOvity
without
outgoing
edge
10
11. Example:
ValidaOon
of
BPMN
Models
Well-‐formedness
validaOon
during
ediOng
o Sink
AcOvity:
acOvity
without
outgoing
edge
11
23. EMF-‐INCQUERY
Development
Tools
• Works
with
most
EMF
editors
out-‐of-‐the-‐box
• Reveals
matches
as
selecOon
Pajern
Editor
EMF
Instance
Model
Query
results
recalculated
on-‐the-‐fly
Query
Explorer
25. Requirements
for
Query
VisualizaOon
Genericity
Incrementality
• MulOple
Model
Sources
• Query
Changes
• Model
Editors
• Model
Changes
• Current
SelecOon
Traceability
PresentaOon
• Query
DefiniOons
• Filtering
• Input
Model
• Grouping
25
26. Proposed
Architecture
of
Query
Visualizer
Edited
Model
Edited
Query
Other
Model
Query
Editors
Sources
Connectors
Model
and
Filtered
group
of
NoOficaOons
queries
Query
Query
Repository
Engine
Query
Query
Result
Query
Results
DefiniOon
Deltas
Query
Result
Viewer
26
27. Model
Source
Connectors
for
Genericity
Different
model
sources
Edited
Edited
Model
Other
Query
Model
o Graphical
(e.g
BPMN,
UML)
Query
Editors
Sources
o Textual
(e.g.
OCL)
Connectors
o Different
implementaOon
Model
and
technologies
Query
NoOficaOons
Model source connectors Engine
OperaOons
Genericity Incrementality
o Open
model
• Multiple Model Sources • Query
Changes
o Send
noOficaOon
upon
model
• Model
Editors
• Current
Selection
• Model
Changes
change
o Get
current
selecOon
Traceability
• Query
Definitions
Presentation
• Filtering
o Close
editor
• Input
Model • Grouping
27
28. Query-‐based
Indexing
for
Incrementality
Update
query
results
Query-‐based indexing
incrementally
upon
o Model
updates
• Contains
model
elements
accessed
• E.g.
using
the
built-‐in
editor
by
the
query
• Engine:
handles
this
case
• Populated
by
an
exhausOve
model
internally
traversal
(can
be
slow!)
o Query
updates
• Goal:
Avoid
unnecessary
re-‐
• E.g.
using
the
query
editor
traversal
• Engine:
rebuilds
internal
model
indexes
Strategy
1:
Generic
model
indexer
Genericity Incrementality
• “Wildcard
mode”:
• Multiple Model Sources • Query
Changes
• Model
Editors • Model
Changes
index
every
model
element
• Current
Selection • Higher
memory
consumpOon
Traceability Presentation Strategy
2:
• Query
Definitions • Filtering Group
iniOalizaOon
• Input
Model • Grouping
• IniOalize
several
pajerns
together
28
29. Traceability
and
NavigaOon
Maintaining
source
models
Query
Editor
Edited
Edited
Model
Query
Query
Editors
Other
Model
Sources
and
queries
Connectors
Support
for
navigaOng
to/
highlighOng
Query
Repository
Query
Engine
o Corresponding
query
definiOons
Query
Result
Viewer
• HighlighOng
funcOonality
in
the
query
editor
Genericity Incrementality
o Referenced
model
element(s)
• Multiple Model Sources
• Model
Editors
• Query
Changes
• Model
Changes
• Editor-‐dependent
• Current
Selection
implementaOon
Traceability Presentation
• Model source connector • Query
Definitions • Filtering
handles
funcOonality
• Input
Model • Grouping
29
32. Grouping
and
Filtering
for
PresentaOon
Define
query
groups
(„related”
queries)
Query
Query
Query
Result
o StaOc
groups
DefiniOons
Results
Deltas
• E.g.
Namespaces
Query
Result
Viewer
o Dynamic
groups
• E.g.
Dependency
based
Filtering
Genericity Incrementality
o Filter
visible
queries
• Multiple Model Sources • Query
Changes
• Model
Editors • Model
Changes
• Uses
hints
from
developer
• Current
Selection
• Manual
overriding
Traceability Presentation
o Filter
query
results
• Query
Definitions • Filtering
• Input
Model • Grouping
• By
binding
query
parameters
32
42. Conclusions
and
Future
Work
R1.
Genericity
Edited
Model
Edited
Other
Model
R3.
Traceability
Query
Query
Editors
Sources
R3.
Traceability
Connectors
R4.
PresentaOon
Model
and
Filtered
group
of
R2.
Incrementality
NoOficaOons
queries
Query
Query
Repository
Engine
Query
Result
Query
Query
Results
Deltas
DefiniOon
Query
Result
Viewer
R4.
PresentaOon
42
43. Conclusions
and
Future
Work
R1.
Genericity
Edited
Model
Edited
Other
Model
R3.
Traceability
Query
Query
Editors
Sources
R3.
Traceability
Connectors
R4.
PresentaOon
Model
and
Filtered
group
of
R2.
Incrementality
NoOficaOons
queries
Query
Query
Repository
Engine
Query
Result
Query
Query
Results
Deltas
DefiniOon
Query
Result
Viewer
R4.
PresentaOon
Future
Plans
• Analysis-‐based
grouping
• Graph-‐based
result
visualizaOon
43