VIATRA 3:
A Reactive Model Transformation
Platform
Gábor Bergmann, István Dávid, Ábel Hegedüs, Ákos
Horváth, István Ráth, Zoltán Ujhelyi and Dániel
Varró
IncQuery Labs Ltd.
Budapest University of Technology and Economics
University of Antwerp
7/22/2015 ICMT 2015, L’Aquila, Italy 1
Reactive model-driven applications
Interference between functions
Commonalities
• Queries, rules, scheduling, conflicts
User
interaction
(modify)
SRC TRG
Batch
transformation
Incremental
transformation
Live validation Live views
Derived features
7/22/2015 ICMT 2015, L’Aquila, Italy 2
Separation of concerns
Reactive
Transformation
Framework
Observed
events
Controlled
events
Actions
What has changed?
When to react?
Perform in
consistent state
7/22/2015 ICMT 2015, L’Aquila, Italy 3
Examples of events and actions
Reactive
Transformation
Framework
Observed
events
Controlled
events
Actions
• Model modified
• Match appeared
• Event sequence identified
• „Run” button pushed
• Consistent state reached
after editing
• Transaction committed
• Modify model
• Add error marker
• Update view
• Send e-mail
7/22/2015 ICMT 2015, L’Aquila, Italy 4
Main concepts
Reactive
Transformation
Framework
Observed
events
Controlled
events
Actions
• Event source
• Event occurrence
(type, data)
• Life cycle
• Jobs
• Scheduler
Rule
specifications
• Agenda
• Executor
• Conflict resolver
7/22/2015 ICMT 2015, L’Aquila, Italy 5
Query language
Xtend (Java)
Language example
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Event data
7/22/2015 ICMT 2015, L’Aquila, Italy 6
Query language
Xtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Language example
Rule specification
7/22/2015 ICMT 2015, L’Aquila, Italy 7
Query language
Xtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Language example
Observed events
7/22/2015 ICMT 2015, L’Aquila, Italy 8
Query language
Xtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Language example
Job specification
7/22/2015 ICMT 2015, L’Aquila, Italy 9
Query language
Xtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Language example
Activation
state-event
transitions
7/22/2015 ICMT 2015, L’Aquila, Italy 10
Query language
Xtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition).
action[ match | // perform action ].build
val incrRule = createRule().precondition(someCondition).
lifecycle(ActivationLifecycles.incremental).
action(::Appeared)[
match | // perform action].
action(::Disappeared)[
match | // perform action].
build
Language example
Jobs associated
with event types
7/22/2015 ICMT 2015, L’Aquila, Italy 11
Batch transformation
Event-driven transformation
Activation life cycles
Phases
Disabled
Appear
Update
Fire
Disappear
Initial
Enabled
Transitions
Updated
/updateJob
/appearJobAppeared
Disappeared
Fired
/disappearJob
/action
Appeared
Only feature of
event data object
has changed
7/22/2015 ICMT 2015, L’Aquila, Italy 12
Conflict resolution
Multiple actions available
• Different activations in the same rule
• Activations of different rules
Which activation to execute next?
Conflict resolver can be selected
• Global conflict set: deals with all rules
• Scoped conflict set: selected rules
7/22/2015 ICMT 2015, L’Aquila, Italy 13
VIATRA Features
7/22/2015 ICMT 2015, L’Aquila, Italy 14
EMF-IncQuery and VIATRA
EMF-IncQuery
• Latest release 1.0: 2015. 06. 30 (graduation)
• “an incremental model query engine”
New VIATRA
• Latest release 0.7: 2015. 06. 30
• “an event-driven and reactive
model transformation platform”
• High-performance model transformation engine
o built on IncQuery technology
• Unique feature:
o supports batch + incremental transformation
o over a unified virtual machine infrastructure (EVM)
• Full Java and EMF compatibility
• Tightly integrated into Xtend
7/22/2015 ICMT 2015, L’Aquila, Italy 15
But there is more…
Complex Event-Processing Engine
• Specify reactions upon detecting
complex sequences of events
• Xtext based language
Design Space Exploration Framework
• Explore design candidates as models
satisfying multiple criteria
Model obfuscator
• Remove sensitive information from confidential models
Coming soon
• MWE2 integration for transformation chains
• Debugger for reactive transformations
7/22/2015 ICMT 2015, L’Aquila, Italy 16
Evaluation
Performance benchmarks
7/22/2015 ICMT 2015, L’Aquila, Italy 17
Test scenario
Different transformation variants
• Batch
o Simple and optimized
o Plain EMF-IncQuery and VIATRA
• Incremental
o Change monitor based
o EVM: explicit traceability and query
result based (QRT)
o VIATRA: query based
Executions
• First transformation execution
• Small modification + (re)execution
Scale SRC Objects SRC References TRG Objects TRG References Trace Objects Trace References
SUM
Objects
SUM
References
1 395 772 366 736 354 720 1 115 2 228
2 849 1 821 773 1 535 762 1 535 2 384 4 891
4 1 694 4 697 1 534 2 972 1 522 3 056 4 750 10 725
8 3 604 17 111 3 266 6 108 3 254 6 520 10 124 29 739
16 7 820 89 193 7 124 12 395 7 112 14 236 22 056 115 824
32 17 714 594 181 16 308 24 837 16 297 32 605 50 319 651 623
64 43 795 4 424 529 40 960 50 028 40 948 81 908 125 703 4 556 465
Different model scenarios
• Industrial (presented below)
• Client-Server
• Publish-Subscribe
Environment
• New machine with 16 GB RAM
Parameters
• 10 GB Heap
• Maximum 10 minutes execution times
for complete chain
Trace model’s size
similar to target model
7/22/2015 ICMT 2015, L’Aquila, Italy 18
Runtime for first transformation
Batch IncQuery + Batch VIATRA
are the fastest
Incremental approaches
are within ~200%
Logarithmic scale!
7/22/2015 ICMT 2015, L’Aquila, Italy 19
Modification and second transformation
As expected
incremental transformation
does well in (re)execution
Logarithmic scale!
7/22/2015 ICMT 2015, L’Aquila, Italy 20
Conclusions - New VIATRA
Reactive Model Transformation Platform
Flexibility and wide range of possible applications
Performance and scalability
Internal DSLs and easy integration
7/22/2015 ICMT 2015, L’Aquila, Italy 21
Final points
22
VIATRA
• Version 0.7 is available
• Generic transformation engine for batch and incremental
transformation chains
• http://www.eclipse.org/viatra/
The examples with all test results and more details are
available form
• https://github.com/IncQueryLabs/incquery-examples-cps/
Your contributions (feedback, forum posts, ideas, bugzillas,
patches) are very welcome!
• To what direction should we enhance the demonstrator and the
VIATRA transformation API?
7/22/2015 ICMT 2015, L’Aquila, Italy

VIATRA 3: A Reactive Model Transformation Platform

  • 1.
    VIATRA 3: A ReactiveModel Transformation Platform Gábor Bergmann, István Dávid, Ábel Hegedüs, Ákos Horváth, István Ráth, Zoltán Ujhelyi and Dániel Varró IncQuery Labs Ltd. Budapest University of Technology and Economics University of Antwerp 7/22/2015 ICMT 2015, L’Aquila, Italy 1
  • 2.
    Reactive model-driven applications Interferencebetween functions Commonalities • Queries, rules, scheduling, conflicts User interaction (modify) SRC TRG Batch transformation Incremental transformation Live validation Live views Derived features 7/22/2015 ICMT 2015, L’Aquila, Italy 2
  • 3.
    Separation of concerns Reactive Transformation Framework Observed events Controlled events Actions Whathas changed? When to react? Perform in consistent state 7/22/2015 ICMT 2015, L’Aquila, Italy 3
  • 4.
    Examples of eventsand actions Reactive Transformation Framework Observed events Controlled events Actions • Model modified • Match appeared • Event sequence identified • „Run” button pushed • Consistent state reached after editing • Transaction committed • Modify model • Add error marker • Update view • Send e-mail 7/22/2015 ICMT 2015, L’Aquila, Italy 4
  • 5.
    Main concepts Reactive Transformation Framework Observed events Controlled events Actions • Eventsource • Event occurrence (type, data) • Life cycle • Jobs • Scheduler Rule specifications • Agenda • Executor • Conflict resolver 7/22/2015 ICMT 2015, L’Aquila, Italy 5
  • 6.
    Query language Xtend (Java) Languageexample pattern someCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Event data 7/22/2015 ICMT 2015, L’Aquila, Italy 6
  • 7.
    Query language Xtend (Java) patternsomeCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Language example Rule specification 7/22/2015 ICMT 2015, L’Aquila, Italy 7
  • 8.
    Query language Xtend (Java) patternsomeCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Language example Observed events 7/22/2015 ICMT 2015, L’Aquila, Italy 8
  • 9.
    Query language Xtend (Java) patternsomeCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Language example Job specification 7/22/2015 ICMT 2015, L’Aquila, Italy 9
  • 10.
    Query language Xtend (Java) patternsomeCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Language example Activation state-event transitions 7/22/2015 ICMT 2015, L’Aquila, Italy 10
  • 11.
    Query language Xtend (Java) patternsomeCondition( param1, param2 ) {...} val rule = createRule().precondition(someCondition). action[ match | // perform action ].build val incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build Language example Jobs associated with event types 7/22/2015 ICMT 2015, L’Aquila, Italy 11
  • 12.
    Batch transformation Event-driven transformation Activationlife cycles Phases Disabled Appear Update Fire Disappear Initial Enabled Transitions Updated /updateJob /appearJobAppeared Disappeared Fired /disappearJob /action Appeared Only feature of event data object has changed 7/22/2015 ICMT 2015, L’Aquila, Italy 12
  • 13.
    Conflict resolution Multiple actionsavailable • Different activations in the same rule • Activations of different rules Which activation to execute next? Conflict resolver can be selected • Global conflict set: deals with all rules • Scoped conflict set: selected rules 7/22/2015 ICMT 2015, L’Aquila, Italy 13
  • 14.
    VIATRA Features 7/22/2015 ICMT2015, L’Aquila, Italy 14
  • 15.
    EMF-IncQuery and VIATRA EMF-IncQuery •Latest release 1.0: 2015. 06. 30 (graduation) • “an incremental model query engine” New VIATRA • Latest release 0.7: 2015. 06. 30 • “an event-driven and reactive model transformation platform” • High-performance model transformation engine o built on IncQuery technology • Unique feature: o supports batch + incremental transformation o over a unified virtual machine infrastructure (EVM) • Full Java and EMF compatibility • Tightly integrated into Xtend 7/22/2015 ICMT 2015, L’Aquila, Italy 15
  • 16.
    But there ismore… Complex Event-Processing Engine • Specify reactions upon detecting complex sequences of events • Xtext based language Design Space Exploration Framework • Explore design candidates as models satisfying multiple criteria Model obfuscator • Remove sensitive information from confidential models Coming soon • MWE2 integration for transformation chains • Debugger for reactive transformations 7/22/2015 ICMT 2015, L’Aquila, Italy 16
  • 17.
  • 18.
    Test scenario Different transformationvariants • Batch o Simple and optimized o Plain EMF-IncQuery and VIATRA • Incremental o Change monitor based o EVM: explicit traceability and query result based (QRT) o VIATRA: query based Executions • First transformation execution • Small modification + (re)execution Scale SRC Objects SRC References TRG Objects TRG References Trace Objects Trace References SUM Objects SUM References 1 395 772 366 736 354 720 1 115 2 228 2 849 1 821 773 1 535 762 1 535 2 384 4 891 4 1 694 4 697 1 534 2 972 1 522 3 056 4 750 10 725 8 3 604 17 111 3 266 6 108 3 254 6 520 10 124 29 739 16 7 820 89 193 7 124 12 395 7 112 14 236 22 056 115 824 32 17 714 594 181 16 308 24 837 16 297 32 605 50 319 651 623 64 43 795 4 424 529 40 960 50 028 40 948 81 908 125 703 4 556 465 Different model scenarios • Industrial (presented below) • Client-Server • Publish-Subscribe Environment • New machine with 16 GB RAM Parameters • 10 GB Heap • Maximum 10 minutes execution times for complete chain Trace model’s size similar to target model 7/22/2015 ICMT 2015, L’Aquila, Italy 18
  • 19.
    Runtime for firsttransformation Batch IncQuery + Batch VIATRA are the fastest Incremental approaches are within ~200% Logarithmic scale! 7/22/2015 ICMT 2015, L’Aquila, Italy 19
  • 20.
    Modification and secondtransformation As expected incremental transformation does well in (re)execution Logarithmic scale! 7/22/2015 ICMT 2015, L’Aquila, Italy 20
  • 21.
    Conclusions - NewVIATRA Reactive Model Transformation Platform Flexibility and wide range of possible applications Performance and scalability Internal DSLs and easy integration 7/22/2015 ICMT 2015, L’Aquila, Italy 21
  • 22.
    Final points 22 VIATRA • Version0.7 is available • Generic transformation engine for batch and incremental transformation chains • http://www.eclipse.org/viatra/ The examples with all test results and more details are available form • https://github.com/IncQueryLabs/incquery-examples-cps/ Your contributions (feedback, forum posts, ideas, bugzillas, patches) are very welcome! • To what direction should we enhance the demonstrator and the VIATRA transformation API? 7/22/2015 ICMT 2015, L’Aquila, Italy

Editor's Notes