Understanding the Scenario File Format

Scenario files should respect the data types specified in the data model for each entity and entity attributes. Each cell is evaluated at import and formatted upon export based on this definition. For more details, please refer to Section Understanding Data Types.

A scenario can be stored in the following formats:

  • .xlsx file: This is the classic scenario import format of the Platform. The Excel file has to be composed of one sheet per entity. Any file with a .xlsx extension is processed as an Excel file.

  • .dbrf file: This format is optimized for the Platform. It is recommended to use the DBRF export and import as often as possible to reduce performance issues when processing large files. Any file with a .dbrf or a .gz extension is processed as a DBRF file.

  • .zip archive containing .csv files: This is the internal format of the Platform. Files in this format are supposed to be used as is. This format is thus undocumented. Any file with a .zip extension is processed as an archive of .csv files (internal format).

When importing a file, the application tries to match entities and entity attributes with the existing table names and column headers:
  1. First, by looking for an exact match;

  2. Then, using case-insensitive matching;

  3. Finally, by removing any white spaces, dashes or underscores.

For example, the following table names are possible:

Entity Allowed names
SolutionSummary

SolutionSummary, Solution Summary, SOLUTION_SUMMARY, solution-summary, SoLuTioN SuMMaRy,...

numberOfHours

numberOfHours, Number of Hours, NUMBER_OF_HOURS, number-of-hours, ...

country.id

country.id, COUNTRY_ID, Country ID, country-id, ...

Within each sheet/entity/table, the first row has one entry per attribute and relation of the entity in the JDL model. The only required columns are the attributes and relations that are part of the business key of the entity, while the other columns may be omitted.

Each row after the first one represents a given instance of the entity. For each column, data should be provided in a format accepted for the corresponding data type.

Note:

Note that:

  • For number types (Integer, Long, Double), the cell has to be parsable as a double. In other words, any values matching the following regular expression are accepted: [0-9]+[.,]?[0-9]*. If the attribute has type Integer or Long, the decimal part will be discarded on import. Integer and Long attributes are exported as [0-9]+.

  • For the Boolean type, the following values are accepted: true, t or 1 for true and false, f, 0 for false.

  • For the String and Binary types, any content is accepted.

  • For date and time types, Excel cells formatted as a Date are supported. Alternatively columns can be formatted as strings following the ISO-8601 format, e.g. "2007-12-03T10:15:30Z", "2007-12-03T10:15:30", "2007-12-03", "10:15:30".

  • For duration types:

    • Duration can be an Excel date, representing a Duration as the interval between day 1899-12-31 0:00 and the cell value.

    • Duration can be a string with the following format 150:20:10.123 where 150 are hours, 20 are minutes, 10 are seconds, and 123 are milliseconds. (Seconds and milliseconds are optional.)

    • ISO-8601 format can be used as well to express a duration.

Here is a simple example.

entity Country {
  id String required
}
entity Plant {
  plantId String required
}
relationship ManyToOne {
  Plant{country} to Country{plants}
}

If the application is defined based on the JDL file above, an exported Excel template would have two sheets, one per table/entity:

  • A first one, named Country, with one column (id);

  • A second one, named Plant, with two columns (plantId and country.id).

For more details, please refer to Section Using Scenario Data Templates.