The CommaSuite Generation Tasks
The CommaSuite framework performs various generation tasks on CommaSuite models. The desired generation tasks are defined in a CommaSuite workflow project, a model with extension .prj. Tasks are grouped per kind and all the tasks of a given kind are given in a single block.
The following is an example workflow project for a simple photo camera. Comments in the code explain the meaning of the constructs. The workflow defines a single generation task: generation of interface documentation.
//Import the models used in generation tasks
import "Camera.interface"
//Alternatively use namespace imports only:
// import projects.camera.*
Project Camera {
//Block for all documentation generation tasks
Generate Documentations {
//task with name docGenTask that generates documentation for ICamera interface
docGenTask for interface ICamera {
template = "Template.docx" //Give the name of the documentation template
targetFile = "result.docx" //Give the name of the generated file
author = "John Smith" //Give the name
role = "R&D: SW Designer" //Give the role
}
}
}
CommaSuite workflow
In order to create a CommaSuite workflow project and to execute the defined generation tasks, follow the steps:
-
In the Eclipse project that contains your models, create a new file with extension .prj.
-
In the created project file, import the required models.
-
Define the desired generation blocks and tasks. Consult the relevant help pages on the details of the supported generation tasks.
-
Once the generation tasks are defined, they can be executed. Right mouse click on the .prj file shows a context menu. Select Run As → Run generators. Alternatively, use the shortcut "ALT+B".
-
Once the generation is finished, the generated files are placed in the sub-folder src-gen. If errors are encountered, a message is conveyed with the location of the error report file.