Welcome to the Fujaba Tool Suite for incremental model transformations and synchronization! This document is intended as a brief introduction to the available tool support for model transformations in the Fujaba Tool Suite.
Model transformations are an integral part of the model-driven software development approach. The requirements and expectations regarding model transformation techniques are very demanding. A practical solution should allow a visual specification of the transformation with an underlying formal foundation. In practice, model transformations are expected both to be applicable in different stages of a development process and in both directions. Additionally, the technology should allow synchronizing different models and keeping them consistent.
Due to the size of complex models, model transformation techniques which require recomputing the transformation even though only a small fraction of the model has been modified do not scale very well. Additionally, retransforming a model each time the model evolves is not practical since refinements in more detailed target models are lost when applying a transformation from scratch. To keep the overall specification consistent after an initial model transformation, changes of one model have to be reflected in a non-destructive manner to the interrelated model.
MoTE/MoRTEn are two plug-ins for the Fujaba Tool Suite which meet these requirements and help developers to specify and execute transformations between models. The plug-ins are based on the visual, formal, and bidirectional model transformation technique of triple graph grammars [Sch94]. Using this declarative specification formalism, the plug-ins efficiently execute transformation rules incrementally which enables model synchronization and round-trip engineering [GW06].
This document is intended as a brief introduction to the available tool support for model transformations in the Fujaba Tool Suite. It uses a simple example to guide the user step-by-step through a model transformation in the Fujaba Tool Suite. The documentation (including this draft user guide, further examples, and tutorials) will be provided with future releases of this software. For issues concerning the technical background on the used model transformation approach, refer to the literature listet at the end of this user guide.
You will need ...
.. and the additional plug-ins
Install the additional plug-ins by unzipping the *.zip files into the plugin directory of Fujaba,
then restart Fujaba. If you have downloaded the plug-ins by the help of Fujaba's plug-in manager,
just restart Fujaba.
BlockDiagramEditor.zip file into the plugin directory of Fujaba and restart Fujaba.
If the block diagram editor was installed properly, you can create a new block diagram by selecting Diagrams > New Block Diagram from the menu. Enter Example when prompted for the diagram name and use the toolbar buttons to create the block diagram shown in Fig. 1.
Fig.1: Create a block diagram with blocks, processes, and connections
The first step to transform a diagram is to setup an appropriate transformation task. For this purpose, open the dialog for plug-in preferences by selecting Options > Plug-ins Preferences from the menu bar. Select the Model Round-Trip Engineering (MoRTEn) tab and press the Add button on the right. As shown in Fig. 2, a new dialog appears. Fill out the dialog to define a new transformation task:
Confirm the settings by pressing the OK button. Enable all transformation directions as shown in Fig. 2, then close the prefereces dialog by pressing the OK button. Now, the transformation engine is initialized and transformations can be carried out.
Fig.2: Define new transformation task
After a transformation task was defined, model transformations can be carried out using the Model Transformation panel. Open the panel by selecting Tools > Model Transformation > Execute... from the menu. Now, the model transformation panel shown in the upper right of Fig. 3 appears and can be used for model transformation and synchronization.
Fig.3: Model Transformation
In order to transform a model, just select the previously created transformation task using the combo box on the left-hand side of the transformation panel. Use the Forward, the Reverse, and the Mapping panel buttons to execute the transformation in a particular direction. For example, to transform the block diagram, just press the Forward button. The class diagram which results from our sample transformation is shown in Fig. 3.
After an initial transformation, models are often modified and changed towards their final design. For example, in Fig. 4, the block diagram was refined by renaming the system block Example to MaterialFlowSystem and the block B1 to Station. In addition, a sub block B3 was added and in the block B2, a new process P2 was inserted and connected to the process P1 by the channel c2.
Fig.4: Modified block diagram
These modifications and refinements can be propagated in a non-destructive manner using the model transformation panel. In order to propage changes from the block diagram to the class diagram, use the Forward button. In Fig. 5, the result of the incremental model synchronization is shown.
Fig.5: Result of the incremental model update
Note that the incremental model synchronization works in both directions. Hence, modifications to the class diagram can be propagated to the block diagram using the Reverse panel button. For example, you can rename the classes which represent blocks or processes. Or, you can add further blocks and/or processes by adding classes to the class diagram. Note that for a successful model synchronization, the classes should be connected by a composition relation to their parent. In addition, a block can only contain either blocks or processes, never both together.
A model transformation is specified by a set of triple graph grammar rules using the TGGEditor. The TGGEditor is available as a plug-in for Fujaba and can be downloaded using Fujaba's plug-in manager. The editor ensures conformance to the source, the correspondence, and the target metamodels involved in a model transformation. For this purpose, the used metamodels have to be specified as class diagrams. The triple graph grammar rules have to be specified with respect to these metamodels.
An example for a triple graph grammar rule is shown in Fig. 10. The rule stems from the example model transformation described in the previous section and specifies a consistent mapping between the objects of a block diagram and a class diagram. In particular, the presented rule defines a mapping between a block and a corresponding class.
Fig.6: A triple graph grammar rule
In order to execute the model transformation, the specified transformation rules have to be compiled to executable transformation engines and bundled in a single rule catalog. In the following, we describe the required steps to obtain such a rule catalog.
Derive a story diagram from each triple graph grammar rule. To derive a story diagram from a triple graph grammar rule, press the Open Rule Generation Dialog button in the toolbar and select MoTE as the rule generation strategy. To generate story diagrams for all specified triple graph grammar rules, activate the Generate All checkbox. Leave all other fields empty and confirm the dialog by pressing the OK button.
Translate the story diagrams to Java code. For this purpose, Fujaba's code generation facilities can be used. Just select Import/Export > Export All Classes To Java from Fujaba's menu. Now, for each transformation rule Java code has been generated.
Create an executable rule catalog. In order to obtain an executable rule catalog, the generated Java code has to be compiled to executable transformation engines which are bundled into a single JAR archive file. In addition, the JAR file has to provide a configuration file with listed transformation engines (cf. configuration.xml provided with the sample block diagram to class diagram transformation example). For this purpose, you can use either Fujaba or any other integrated development environment, e.g., Eclipse.
The archive represents the catalog of transformation rules defining the model transformation specified by a triple graph grammar. Once the catalog is available, model transformations can be carried out (cf. Sample).
Release 1.2
This is the first official release of plug-ins for incremental model transformation and synchronization. It consists of:
You can download the required plug-ins via the "Manage Plug-Ins" dialog within the Fujaba Tool Suite or directly through the plug-ins download page. The Fujaba Tool Suite is available through our download page.
Please, contact me if you would like to report a problem, request a new feature or if you have further questions or comments on this plug-in.
Email: wagner[at]uni-paderborn.de
Copyright © 2006 Fujaba Development Group - University of Paderborn
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA or download the license under http://www.gnu.org/copyleft/lesser.html
This is a list of frequently asked questions. If you have further questions, please feel free to contact me.
What is MoTE/MoRTEn?
MoTE/MoRTEn are two plug-ins for the Fujaba Tool Suite enabling model transformations based on the technique of triple graph grammars. MoTE is the abbreviation for Model Transformation Engine. It is the core library for the execution of triple graph grammars and can be also used without Fujaba. MoRTEn is the abbreviation for Model Round Trip Engineering. MoRTEn integrates the MoTE library into Fujaba and provides a graphical user interface to instantiate concrete transformation tasks. It also provides a toolbar to control a particular transformation. MoRTEn is intended to be used to test a specified model transformation during development. After a transformation is specified and tested, it can be integrated into your software tool using the MoTE library.
What are the benefits using triple graph grammars for model transformations?
The technique of triple graph grammars [Sch94] allows a visual specification of a model transformation. Triple graph grammars are formal and therefore, there is a rich theory behind them. Since it is a declarative technique, bidirectional transformations are possible from one and the same specification. Additionally, triple graph grammars can be executed either in a batch-oriented way to transform a model from scratch, or incrementally, which allows model synchronization when models evolve.
Journal articles and conference papers
[Sch94] A. Schürr: "Specification of Graph Translators with Triple Graph Grammars", in: G. Tinhofer (ed.), WG'94 20th Int. Workshop on Graph-Theoretic Concepts in Computer Science, Springer Verlag, 1994, Lecture Notes in Computer Science (LNCS), Vol. 903, 151-163.
[GW06] H. Giese and R. Wagner: "Incremental Model Synchronization with Triple Graph Grammars", in: O. Nierstrasz, J. Whittle, D. Harel, and G. Reggio (ed.), Proc. of the 9th International Conference on Model Driven Engineering Languages and Systems (MoDELS), Genoa, Italy, October 2006, Springer Verlag, 2006, Lecture Notes in Computer Science (LNCS), (to appear).