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 03/02/2022 ICMT 2015, L’Aquila, Italy 1
22
Embed
VIATRA 3: A Reactive Model Transformation Platform
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
05/01/2023 1ICMT 2015, L’Aquila, Italy
VIATRA 3:A Reactive Model
Transformation PlatformGá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
05/01/2023 2ICMT 2015, L’Aquila, Italy
Reactive model-driven applications
Interference between functionsCommonalities• Queries, rules, scheduling, conflicts
User interaction(modify)
SRC TRGBatch transformation
Incremental transformation
Live validation Live views
Derived features
05/01/2023 3ICMT 2015, L’Aquila, Italy
Separation of concerns
Reactive Transformation
Framework
Observed events
Controlled events
Actions
What has changed?
When to react? Perform in consistent state
05/01/2023 4ICMT 2015, L’Aquila, Italy
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
05/01/2023 5ICMT 2015, L’Aquila, Italy
Main concepts
Reactive Transformation
Framework
Observed events
Controlled events
Actions
• Event source• Event
occurrence(type, data)
• Life cycle • Jobs
• Scheduler
Rule specification
s
• Agenda• Executor
• Conflict resolver
05/01/2023 6ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
Language examplepattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build
Event data
05/01/2023 7ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build
Language exampleRule specification
05/01/2023 8ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build
Language example
Observed events
05/01/2023 9ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build
Language example
Job specification
05/01/2023 10ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval incrRule = createRule().precondition(someCondition). lifecycle(ActivationLifecycles.incremental). action(::Appeared)[ match | // perform action]. action(::Disappeared)[ match | // perform action]. build
Language example
Activation state-event transitions
05/01/2023 11ICMT 2015, L’Aquila, Italy
Query languageXtend (Java)
pattern someCondition( param1, param2 ) {...}
val rule = createRule().precondition(someCondition). action[ match | // perform action ].buildval 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
05/01/2023 12ICMT 2015, L’Aquila, Italy
Batch transformation
Event-driven transformation
Activation life cyclesPhases
Disabled
AppearUpdate
FireDisappear
Initial
Enabled
Transitions
Updated
/updateJob
/appearJobAppeared
Disappeared
Fired/disappearJob
/action
Appeared
Only feature of event data object has changed
05/01/2023 13ICMT 2015, L’Aquila, Italy
Conflict resolutionMultiple actions available• Different activations in the same rule• Activations of different rulesWhich activation to execute next?Conflict resolver can be selected• Global conflict set: deals with all rules• Scoped conflict set: selected rules
05/01/2023 14ICMT 2015, L’Aquila, Italy
VIATRA Features
05/01/2023 15ICMT 2015, L’Aquila, Italy
EMF-IncQuery and VIATRAEMF-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
05/01/2023 16ICMT 2015, L’Aquila, Italy
But there is more…Complex Event-Processing Engine• Specify reactions upon detecting
complex sequences of events• Xtext based languageDesign Space Exploration Framework• Explore design candidates as models
satisfying multiple criteriaModel obfuscator• Remove sensitive information from confidential modelsComing soon• MWE2 integration for transformation chains• Debugger for reactive transformations
05/01/2023 17ICMT 2015, L’Aquila, Italy
Evaluation
Performance benchmarks
05/01/2023 18ICMT 2015, L’Aquila, Italy
Test scenarioDifferent transformation variants• Batch
o Simple and optimizedo Plain EMF-IncQuery and VIATRA
• Incremental o Change monitor basedo 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 ReferencesSUM Objects
Different model scenarios• Industrial (presented below)• Client-Server • Publish-SubscribeEnvironment• New machine with 16 GB RAMParameters• 10 GB Heap• Maximum 10 minutes execution
times for complete chain
Trace model’s size similar to target model
05/01/2023 19ICMT 2015, L’Aquila, Italy
Runtime for first transformation
Batch IncQuery + Batch VIATRA are the fastest
Incremental approaches are within
~200%
Logarithmic scale!
05/01/2023 20ICMT 2015, L’Aquila, Italy
Modification and second transformation
As expected incremental transformationdoes well in (re)execution
Logarithmic scale!
05/01/2023 21ICMT 2015, L’Aquila, Italy
Conclusions - New VIATRAReactive Model Transformation Platform
Flexibility and wide range of possible applications
Performance and scalabilityInternal DSLs and easy integration
05/01/2023 ICMT 2015, L’Aquila, Italy
Final points
22
VIATRA • Version 0.7 is available• Generic transformation engine for batch and incremental