The goal fo the MOFScript Model to Text transformation is the generation of Java source code compatible to the abstract architecture implementation from the information layer models (PIM).
To carry out this task, the PIM is marked using the Deployment model to create the PSM which is turned into Java source code after performing the MOFScript transformation.
Tu run the Model to Text transformation you have to:
- Install the MOFScript plugin (Update site: http://depot.universaal.org/eclipse-update/). Then go to AAL Studio Prerequisites and select MOFScript
- Create a Java project (File-> New -> Java Project)
- Create a directory, name it «models», and copy source models (space reference, information flow, entity context and deployment). Note that you can use the light intensity, healthy screen and sharedblack board scenario models as samples
- Create a directory, name it «transformations»
- Uncompress the «InformationLayerToCode.zip» file, and copy the «InformationLayerToCode.m2t» MOFScript transformation file to «transformations» directory
- Create a directory, name it «lib»
- Uncompress the cauce-architecture.zip file, and copy the «cauce-architecture.jar» file into the «lib» directory
- Add the «cauce-architecture.jar» file to the project classpath
- Verify the project structure (check Figure 80)
- Go to Window -> Preferences and then MOFScript Preferences and configure the model and transformation paths accordingly (i.e. Figure 81)
- Open the transformation file and go to the execute transformation icon on the toolbar (see Figure 82)
- Select input models in the following order: deployment, referential space, information flow models and entity context models
- Copy the results generated in the c:/temp/ directory to the project «src» directory
Configuration and execution of the MOFScript M2T PSM to Java source code compatible to the Abstract Architecture for developing CAAs for UCEs.
You can reference this work as:
Ricardo Tesoriero, José A. Gallud, María D. Lozano and Víctor M. R. Penichet. CAUCE: Model-driven Development of Context-aware Applications for Ubiquitous Computing Environments. Journal of Universal Computer Science, Vol. 16, No. 15, pp. 2111-2138. 2010. Link: http://www.jucs.org/jucs_16_15/cauce_model_driven_development