A model library in a Modelio 3 project is a set of non-modifiable model elements that is required for the development of your project, packaged in a single artefact.
A very basic example for Java projects is the JDK. Many classes from the JDK can be used in your model. These required JDK classes can be brought into your project via a model library. Obviously, the JDK model is not intented to be modified, that's why the JDK model library must be read-only.
There are two kinds of libraries in Modelio 3:
- Model Component libraries which are local libraries similar to the former model components of Modelio 2
- HTTP Libraries which are remote libraries, accessible via HTTP and consequently distributed
You can declare as many additional libraries in your project as required, mixing local and remote ones.
Library management is carried out in the Libraries tab of the Project configurator dialog.
- Click on "Configuration\Libraries…" or on the  icon then select the 'Libraries' tab.
- You can add local libraries to your project, or update, consult or remove existing ones.
- You can add remote libraries to your project, or refresh, consult or remove existing ones.
Create a Model Component library
From an existing UML model, we can create a model component.
To create a model component, follow the steps shown below.
- Right-click on the root of your project and run the "Create a model component..." command.
- Enter a name, version and version history.
- From the UML explorer, drag and drop model elements you want your model component to reference.
- From the UML explorer, drag and drop model components on which your model component will depend.
- Check the modules which are contributing to your model component.
Defining model parts to be included in a model component
Model elements to be included in a model component are referenced using manifestation links. These elements will be available for use in projects where the model component is deployed. Only high-level packages (packages located under the project root) can be referenced by a model component through a manifestation link. However, all the elements they contain will also be packaged in the model component.
Modeling dependencies between model components
If your model component is dependent on another model component, this fact must be modeled through a use link.
Defining external files to be included in a model component
External files can also be included in a model component. This is useful when you want your model component to install specific files like libraries, jar files or resource files when it's deployed.
For example, let's imagine that you have reversed the Java JDK, in order to produce a reusable component. This type of model component, when deployed, should allow Java application development including compilation, meaning that JDK jar files would then have to be deployed by the model component.
When defining external files to be included in a model component, the $(GenRoot) variable should be used. This variable is the root directory for generation, and can be defined by each user at Modelio parameter level, which means that the external files included in the model component will be deployed correctly in each user's own individual environment.
Once you are satisfied that you have carried out all these steps correctly, click on "Apply" to confirm your changes and close the model component edition window.
You can proceed with the packaging of your model component by clicking on 'Package'.
Create a remote library
From an existing Modelio project, we can create a remote library.
First of all, you must close the project containing the UML model that you want to export as a remote library. It is preferable to close Modelio before starting.
Let's name the directory of the library project $PROJECT and the work model in which the library model resides $MODEL.
- Prepare an empty directory ($LIBRARY in the followings) where the files to upload to the server will be prepared.
- Copy the content of the $PROJECT/data/fragments/$MODEL/admin directory into the $LIBRARY/$MODEL/admin directory.
- Copy the content of the $PROJECT/data/fragments/$MODEL/blobs directory into the $LIBRARY/$MODEL/blobs directory.
- Copy the content of the $PROJECT/data/fragments/$MODEL/model into the $LIBRARY/$MODEL/model directory.
- Copy the content of the $PROJECT/.runtime/fragments/$MODEL/.index into the $LIBRARY/$MODEL/.index directory.
- Upload the entire contents of $LIBRARY to the HTTP server hosting the library.
After the upload, the library should be available for addition in Modelio 3 projects at your will, using the URL resulting from the HTTP server configuration.
- Model components detailed documentation
- Remote libraries detailed documentation
- Configuring project libraries