Snapshot export

Domain export

In Hyperon Studio there is functionality that allows users to export current domain definition and configuration into a compact zip file for specified profiles.

Required input:

  • at least one chosen profile name
  • valid domain definition and configuration

Domain File system structure

IMPORTANT

In the snapshot ZIP file any directories with names starting with '@' have special meaning. They define the structure of snapshot file. Names of other directories (not starting with '@') are part of import data. For example, they may be interpreted as parts of domain element's name or names of profiles, depending on where they are in the directory structure.

Directory structure

The part of the directory tree of the snapshot zip file related to the domain has the following structure:

/ (root directory of ZIP file)
|
+--Other optional content (directories or files)
|
+–-@domain/
   +--PROFILE_1/
   |  +--@conf/
   |  |  +--PLANS/
   |  |  |  +--ABC/
   |  |  |  |  +--info.txt
   |  |  |  |  +--attributes.txt
   |  |  |  |  +--RISKS/ 
   |  |  |  |     +-- other domain elements...
   |  |  |  +--@regions/
   |  |  |  |   +--REGION_1/
   |  |  |  |   |  +--1/
   |  |  |  |   |  |  +--HMM/  
   |  |  |  |   |  |  |   +-- other domain elements and files..
   |  |  |  |   |  +--2/
   |  |  |  |   |  |  +--GIT/  
   |  |  |  |   |  |  |  +-- other domain elements and files..
   |  |  +--PLANS_REF/
   |  |  |  +--ABC/
   |  |  |  |  +--reference.txt
   |  +--@def/
   |  |  +-- PROFILE_1.xml
   +-- other profiles...

Exporting Domain in the Hyperon Studio

To export domain in Hyperon Studio, go to Tools → Snapshot Export, check Domain checkbox, choose profiles from which domain should be exported and click the Export button.A popup window will appear. When the export is finished and no errors occurred, click the Download button to download snapshot in the zip file. If any error during export happens, an error message will be shown and the Download button will be unavailable to click.

Exporting Domain via REST

Endpoint path, method, response statuses are available here: REST export endpoint

To export Domain via REST, the section below must be present in the REST request:

{
   "profiles":["PROFILE_1"],   // which profiles should be used for export. If not present, user's currently selected profile is chosen
    "domain": {                 // if this node is present, domain will be exported for "PROFILE_1"
        "fromSession" : false  // it will export full domain tree
   }
}

@domain/ directory

Located in a top-level of the zip file directory and contains the domain content. Each subdirectory of @domain/ stands for the profile with the same name as the directory name, with the same name as the folder name. Inside each profile folder there are two subdirectories:

  • @conf/ - contains full domain configuration with all regions and versions support. (Domain export will NOT export regions and versions itself!!)
  • @def/ - contains domain definition in XML file, named the same way as profile

@conf/ directory

Located under @domain directory, the structure inside the @conf/ folder or inside each individual version directory defines domain structure. The path to a specific directory defines the Hyperon domain path, for example, /PLANS[ABC] corresponds to ABC element in PLANS collection located at the root level in structure example above. Collection directory is always present, even if multiple checkbox is set to false in domain definition. Element directories, for example, ABC might have:

  • other directories to deeper domain elements
  • info.txt
  • attributes.txt
  • reference.txt

@regions/ directory

Marks that all nested directories will be imported as part of the region and version. Proper structure is:

@regions/[REGION_CODE]/[VERSION_NUMBER]/...

info.txt

Holds basic information about current domain element in TOML format, for example:

name = "first insurance"

attributes.txt

Holds information about the current domain element's attributes in TOML format, for example:

[[attr]]
attributeCode = "age" 
attributeName = "age" 
refType = "LITERAL" 
refName = "50" 
 
[[attr]]
attributeCode = "name" 
attributeName = "name" 
refType = "PARAMETER" 
refName = "demo.par.name" 
 
[[attr]]
attributeCode = "surname" 
attributeName = "surname" 
refType = "FUNCTION" 
refName = "demo.func.getSurname" 

reference.txt

Holds reference path uniquely locating domain element, to which current element should be forwarded, for example:

/plans[ABC]

<profile_name>.xml

Contains domain definition. It is the same file that you receive during domain export in Hyperon Studio (Model Domain ConfigurationExport to XML)

IMPORTANT
Export of empty definition or configuration (domain) will result with basic tree structure, ready to be used outside of Hyperon

IMPORTANT
If collection is empty, then the export of domain will not have the corresponding directory with the collection name!! There must be at least one child in a collection of a processed type so that the directory will be created.