Old transformation configurations and the model compiler
Starting with Model RealTime 10.3, the support for transformation configurations (TCs) in the old XML format (.tc) was removed and replaced with support for a new JavaScript format (.tcjs). Because of this, some legacy features have been removed and replaced with better alternatives:
- The old C++ code generator (sometimes known as the "classic builder") is no longer included in Model RealTime. It has been replaced by the model compiler.
- TCs in the old format (*.tc) can no longer be created. All newly created TCs will use the new JavaScript format (*.tcjs).
Deprecated features that were removed in 10.3
Even though the model compiler has many benefits over the old C++ code generator, it doesn't support everything which the old code generator did. The following are not supported:
- C code generation
- Marking models
Likewise, the switch to a new TC format has removed some old features:
- Reading and writing old TC files by means of the Transform API (com.ibm.xtools.transform.*). You can accomplish similar things by means of tools and libraries that work on JavaScript files, for example Nashorn.
- Visualization of TCs as components in UML diagrams. However, you can visualize relationships between TCs in the new format as shown here: Graphic visualization of TC relationships
To convert an old .tc file to a new .tcjs file, follow these steps:
- Make sure the old .tc files are visible in the Project Explorer by invoking the Filters and Customization command in the view menu. In the Pre-set filters tab, make sure Legacy Transformation Configuration Files is unmarked.
- Right-click on the .tc file that you want to convert and perform the command Convert to JavaScript. The TC and all its prerequisite TCs will then be converted to the new JavaScript-based file format (.tcjs).
It is recommended to start the conversion on each top-level TC, and test that it can be built, before proceeding with the next top-level TC.
By default a converted .tcjs file is placed next to the original .tc file. However, if that location is read-only the new file will instead be placed next to the top-level .tc file.
It should be noted that even if you cannot create new TCs in the old format anymore, you can still build existing TCs in the old format with the model compiler. Hence, you don’t necessarily need to migrate all existing TCs to the new format before you can build your application with the model compiler. However, TCs that remain in the old format need to be edited using Model RealTime 10.2.
Notes on adopting the model compiler
The classic builder is no longer part of Model RealTime, but the build user interface is the same as before. Therefore, most scenarios work the same with the model compiler as with the old C++ code generator. However, there are a few things you should be aware of:
- The model compiler by default prints messages produced by 'make' in the UML Development console. However, it can also write them to a build log, and then include a link to this build log from the console. If you prefer this behavior, disable the preference RealTime Development – Build/Transformations – Show make log in UML Development Console.
- The model compiler can be started in a server mode and act as a build server. In this mode it remains running to serve requests coming from the Model RealTime IDE. This significantly speeds up performance of many build-related operations. However, it requires that each instance of Model RealTime has exactly one such build server instance which listens to a specific port for requests. If you have many Model RealTime instances running on the same machine, you may therefore have to raise the default port range used by the build server. Adjust the preference RealTime Development – Build/Transformations – Port range to specify a large enough port range.
- The model compiler is more strict than the classic builder, which means you may see error messages for models that previously could be successfully built. Fixing those errors will improve the quality of your models, and will not make them impossible to build with the classic builder.
Your biggest effort with adopting the model compiler will likely be to update all build scripts you may have for doing batch builds. Refer to the document Model Compiler for detailed information about how to invoke the model compiler from the command line or from scripts.