JSFileLibrary modeling

A JSFileLibrary is a Rhapsody ControlledFile linked to a physical JavaScript file (*.js). It can be used as a JavaScript library to share between different projects. It is recommended to use it as layer on top of the Rhapsody Java API to ease rules development. The .js file can contain JavaScript Functions or Variables, which are accessible everywhere in the M2MExportRuleset JavaScript context (including initM2MIE.js, JSRunnables, JSFunctions, JSFileLibraryies). The file can not be edited directly in Rhapsody, and must be edited via an external text editor or JavaScript editor. When double-click on it in the Rhapsody browser, it asks the Operating System to open the .js file with the default application for JavaScript files. In some cases, it will try to execute the script and it will display an error pop-up window with an error. To avoid this, right-click on a .js file in the window explorer, and configure to use Notepadd++ for example to open .js files by default.

A JSFileLibrary can be created into M2MEPackage elements via the context menu Add New | M2M | JSFileLibrary:

Add new JSRunnables