Modelling Tools for use with Enterprise Architect
Folder and file names must only contain lower case characters and must
not contain any whitespaces. A hyphen must be used to separate words in
a folder or file name. Those scripts that are not executable themselves,
but are included by other scripts, must have a name that starts with an
underscore, e.g. _model-utils
.
In order to be able to create a meaningful README file containing the documentation of all scripts, each executable script must be documented using JSDoc. The following code snippet illustrates this.
/**
* Description of what this script does.
*
* The description can span multiple lines.
*
* @summary Optional summary, especially useful when the description is long (remove this line when the summary is not needed).
*/
function main() {
// logic of function main
}
main();
Note that the JSDoc comment must be placed immediately before the function being documented, blank lines must not be present between the comment and the function. It is good practice to document all the methods present in a script. However, the JSDoc comment that is exported to src/README.md is the comment that documents the function called in the script.
The comment must not contain any @ signs apart from the ones in the JSDoc tags.
Enterprise Architect embeds the SpiderMonkey JavaScript engine, see also the website of Sparx.
However, because the code that parses the scripts and extracts the documentation is based on Rhino (an open-source implementation of JavaScript written in Java), that does not yet support all features in ECMAScript edition 6 (2015), the use of certain features will result in an error in the documentation extraction and must therefore be avoided. See also this compatibility table showing Rhino ES2015 support.