Defining a Composite Data Model (CDM)

The Platform allows chunking the data model into different components that can depend on one another in a composite data model.

By default, a simple data model application declares only one scenario type while a composite data model declares several scenario types.

In a CDM, a scenario type only describes some entities of the data model. However, it can reference or be referenced by other scenario types to provide the user with all the relevant data when necessary.

This improves performances as it prevents duplicating data and allows synchronizing parts of the model for the purpose at hand. For example, instead of managing a large amount of scenarios with the same reccuring data everytime an operation is performed on an entity attribute, users only need the type of scenario that describes the entity in question.

This makes sense in the example below where the Plant and Country entities from the MasterData scenarios or the Truck Route in the DeliveryData scenarios are less likely to change overtime than the daily Schedule described in the PlanData scenarios.

Example of Composite Data Model

A composite data model is described across several JDL files, located in the gene-model/spec directory of the project, either directly or organized in subfolders.

Among the JDL files that define the data model description, exactly one must contain an application block. It is called the “main JDL file“, capacity_planning.jdl here.

In a CDM, as opposed to a simple data model, the application block should contain include statements that indicate the additional JDL files to consider in the definition of the data model. Here is an example:

application {
  // DOM [java.collectorClass] : [CapacityPlanning]

  include "master_data.jdl"
  include "delivery_data.jdl"
  include "transactional_data.jdl"
  include "plan_data.jdl"
}

The paths of the included JDL files are considered to be relative to the directory where the main JDL file is stored.