Skip to content

Model Depository Configurations

After a database is successfully setup, users should configure the Tool so that it can connect to the database via ODBC connector. To do it, a database Model Depository configuration must be added in the Tool’s server configuration. Although the primary goal to configure Model Depository is the setup of Database connection, Model Depository configuration also includes the setup of Model Management activity log and the modification of default parameters for Model Depository per user’s preference.

There are two server configuration files: one is the standard configuration which users are not supposed to change; the other is custom configuration designed for users to customize. Model Depository configuration resides in the custom configuration file.

DBConfig and DBConnection in custom configuration file are used to set up Model Depository configuration. They are nested under XMLServerConfig->ModelConfig -> IOConfig.

Model Depository Configurations – figure 1

One DBConnection corresponds to one Model Depository. Model Depository is uniquely identified by the name attribute of DBConnection. The Tool allows multiple DBConnection defined under one DBConfig or multiple DBConfig with one or more DBConnection. By doing that, users can select different Modelspace to work with.

It is highly recommended that DBConnection’s name be intuitive by containing database name and seed model name.

Setup Model Database Connections

Database Model Depository is connected through ODBC connector. The following parameters should be set to configure the connection:

  • odbcConnection -- must be true; database is connected through ODBC connector.
  • dbType -- type of database; the Tool supports virtually any relational database. The official supported RDBMS are MSSQL, MYSQL, and ORACLE.
  • Connection -- ODBC connection string that is required by the database you are connected to. A valid connection string should have the following attributes. The attributes are separated by “;”.
  • Driver: the name of the ODBC connector, which is set up when ODBC connector is installed.
  • Server: the name of database server instance. The value must be either the name of the server on the network or an IP address.
  • Database: the name of the default database for the connection, it must be existing database created. Details of database creation can be found under the sections of configure database server for Modelspace. For Oracle, as the database and user is one-to-one mapped, there is no need to define Database attribute.
  • Uid and Pwd: a valid database server login account and password. They should be set up when database is created

The following table summarizes the attributes that are used for the sample connection strings of MS SQL Express, MySQL, and Oracle. Users should follow company’s security policies on setting up database credentials in production environment.

MS SQL Express MySQL Oracle
Driver {SQL Server Native Client 11.0} {MySQL ODBC 5.3 Unicode Driver} {Oracle in XE}
Server localhost localhost localhost
Database cimdb cimdb n/a
Uid root root root
Pwd powerinfo powerinfo powerinfo
  • MS SQL Express

Connection ="Driver={SQL Server Native Client 11.0};Server=localhost\SQLEXPRESS;Database=cimdb;Uid=root;Pwd=powerinfo;"

  • MySQL

Connection="Driver={MySQL ODBC 5.3 Unicode Driver};Server=localhost; Database=cimdb; Uid=root;Pwd=powerinfo;”

  • Oracle

Connection ="Driver={Oracle in XE};Server=localhost; Uid=root;Pwd=powerinfo;"

After database installation, users need to customize the database connection in the custom configuration file, usually “CustomConfig.xml” in the Tool’s config folder on server computer. Open the configuration file in a text editor and follow these steps to update the database connection string.

  1. Find out the Driver name based on the database installed. Replace everything after “Driver=”. image004

If MySQL is the Model database, although MySQL has two drivers, it is recommended to use “MySQL ODBC 5.3 Unicode Driver” as Unicode supports more characters.

  1. Find out the name of the database server on the network or the IP address. Replace everything after “Server=”. image006
  2. Find out the database name. Replace everything after “Database=”. This is not applicable for Oracle. image008
  3. Find out the database server authentication, i.e. username and password. Replace the strings after “Uid=” and “Pwd=”. image009

Setup Model Depository Activity Log

Proper logging of the activities provides a mechanism to keep track of activity histories, including time, type, status, and any errors or warnings identified.

  • loggingEnabled: if true, logging of Model Depository activity is enabled.
  • logFileName: the location and log file name if logging is enabled.
  • logAppending: by setting to “true”, new log item is always appended to the log file. Log file’s size will continuously grow. By setting to “false”, logging is per activity, i.e. new Model Depository activity log will overwrite previous logs. Log file’s size is more manageable in that case.

Modify Default Parameters

One key feature of the Tool is that database schema is auto-generated from the governing model profile. There are three families of database tables for Model Depository: full model tables (for base model), incremental model tables (for Projects), and model management tables (for model administration). To differentiate tables in different family, prefixes are added to table names. Users can overwrite default prefixes by setting one or more of the following optional parameters:

  • fullModelTablePrefix: prefix for full model tables;
  • incrModelTablePrefix: prefix for pending change (Project) tables;
  • modelManagementTablePrefix: prefix for model management tables. Model Depository Configurations – figure 6

While the max allowable sizes of string-type columns are primarily determined by the profile specifications, users can customize these sizes by specifying the following parameters to overwrite the built-in default values:

  • minIDLength: Minimum ID length. Default value is 120.
  • minEnumLength: Minimum enumeration length. Default Value is 80. Also applicable to Boolean data type.
  • minNameLength: Minimum name (IdentifiedObject.name) length. Default Value is 0.
  • minDescLength: Minimum description length (IdentifiedObject.description). Default Value is 0.
  • minStrPropLength: Minimum other string-type column length. Default Value is 0.

As an example, the size of column name is normally 32 chars according to profiles. Users can extend the column size of to 64 chars by specifying the following:

Model Depository Configurations – figure 7

Note

these parameters are ‘minimum’ values, meaning if the sizes specified in the profiles will be used if they are greater than the corresponding min lengths defined in the configuration file.

Define a Data Source for a Model Depository

Data source is defined to enable users to easily load frequently used models with one-button-clicking. A data source from Model Depository can be pre-defined in configuration file.

The following attributes need to be specified as illustrated by the following example.

Model Depository Configurations – figure 8

  • name – data source name, displayed in UI
  • type – M3_DB indicates the data source is a database Model Depository.
  • Location – Model Depository name, must be a valid DBConnection.

Once the data source is defined, users can load Model Administration Meta-Model from the data source dropdown list.

Model Depository Configurations – figure 9

Trouble Shooting in Modelspace Configuration

  • Database connection error:

Connection string has five attributes: driver, server, database, user id, and password. If any of them goes wrong, you will most likely get a message like below. To fix it, carefully check the database setup again and copy the correct string(s) into connection string.

Model Depository Configurations – figure 10

  • Modelspace activity log file is getting too big.

You can simply delete/rename the log file. Or set the logAppending to false.

  • Tables with old prefix are still in Modelspace after initialization, although new prefix is set up in configuration file.

Tables in Modelspace are auto-generated during Modelspace initialization. However, initialization will not remove tables with unknown prefixes coming from previous initialization. You have to remove them in the database management portal.