VIATRA 3: A reactive model transformation platform
-
Upload
akos-horvath -
Category
Software
-
view
353 -
download
0
Transcript of VIATRA 3: A reactive model transformation platform
05/02/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/02/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/02/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/02/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
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/02/2023 ICMT 2015, L’Aquila, Italy 5
05/02/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/02/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/02/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/02/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/02/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/02/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/02/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/02/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/02/2023 14ICMT 2015, L’Aquila, Italy
VIATRA Features
05/02/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/02/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/02/2023 17ICMT 2015, L’Aquila, Italy
Evaluation
Performance benchmarks
05/02/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
SUM References
1 395 772 366 736 354 720 1 115 2 2282 849 1 821 773 1 535 762 1 535 2 384 4 8914 1 694 4 697 1 534 2 972 1 522 3 056 4 750 10 7258 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 82432 17 714 594 181 16 308 24 837 16 297 32 605 50 319 651 62364 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-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/02/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/02/2023 20ICMT 2015, L’Aquila, Italy
Modification and second transformation
As expected incremental transformationdoes well in (re)execution
Logarithmic scale!
05/02/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/02/2023 ICMT 2015, L’Aquila, Italy
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?