Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Table of Contents


scrollbar



What

Required

Description

schema location

ModuleInstanceDescriptors.xml

yes

Definition of instances of modules

httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/moduleInstanceDescriptors.xsd

Each module configured in DELFT-FEWS must be registered in the ModuleInstanceDescriptors configuration. This is required to identify the module to DELFT-FEWS (the name is free format), but is also required to define the type of module through reference to the moduleDescriptors defined (see system configuration).

...

Attributes;

  •         Id: Id of the Module Instance group. This Id must be unique. Normally a string is used that gives some understanding of the role of the module (e.g. SpatialInterpolationPrecipitation).
  •         name: Optional name for the module group. Used for reference purposes only.


moduleinstanceDescriptor 

One of the element is the ModuleInstanceDescriptors, as defined earlier.  All instances of Modules defined here need not be defined again as individual moduleInstance. Each group can have multiple modules instances.

However following points to be taken into considerations when defining moduleInstances under a single group.

  • If one module instance in a group has a reference to a simulated historical, all module instances in the group should have a reference to a  simulated historical module.

  • All referenced simulated historical moduleinstances should also belong to the same group. 

  • The ModuleInstancegroup for Historical and Forecast should match i.e. each module instance defined in historical  (updatestates) module instance group should match on one-to-one basis with the forecast modules instance group. This means that no modulesintances such as export, import should be added to module instance group. 
  • A correct configuration example is shown as below. The total number of modulesinstances in update (historical) and forcast matches. Also the referenced simulated historical modules instances in LMBM5_Forecast modules instance group also belongs to a one same module instance group i.e. LBNM5_UpdateStates". 

  • An incorrect configuration example is shown as below. Here the Forecast modulesinstancegroup contains 10 moduleInstancegroup  while (historical) update moduleinstancegroup contains 9. It is strongly recommended to avoid this.


  • Module Instance group is used to mainly optimize the way the data is written to the database. This leads to compact databases. Otherwise Modules Instance groups cannot be referred to retrieve data from database.




Module instance descriptors in csv format with attributes

Since 2022.01 it is possible to define module instance in a csv file.  It is only possible to add attributes to the module instances when the csv format is used. These attributes can be used in file export with the %MODULE_INSTANCE_ID_ATTRIBUTE(attributeId; moduleInstanceId)% tag. Standard field names like 'description' can be used as attributes if they are explicitly configured (see attribute 'DESC' doubling the link to the 'description' column of the csv file in the example below)

By using %% can be referred to the content of the columns in the csv file.
For example:. If number format is expected, the reference may also include calculations, as is done in the example for the waterCoachExternalForecastDelayMinutes column.
Example:


Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>


<moduleInstanceDescriptors xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


                     xsi:schemaLocation="http://www.wldelft.nl/fews
http
 https://
fews
fewsdocs.
wldelft
deltares.nl/schemas/version1.0/moduleInstanceDescriptors.xsd" version="1.0">


   <moduleInstanceDescriptorsCsvFile>


        <file>moduleInstanceDescriptors.csv</file>


       
<id>%ID%</id>
      <attribute id="test">
         <text>%test%</text>
      </attribute>
      <attributeFile>
       
 <id>%moduleInstanceId%</id>
        <name>%moduleInstanceName%</name>
        <description>%description%</description>
        <group>%groupId%</group>
        <groupName>%groupName%</groupName>
        <updateModuleRunTimesOnCompletion>%updateModuleRunTimesOnCompletion%</updateModuleRunTimesOnCompletion>
        <simulatedHistoricalModuleInstanceId>%simulatedHistoricalModuleInstanceId%</simulatedHistoricalModuleInstanceId>
        <waterCoachExternalForecastDelayHours>%waterCoachExternalForecastDelayMinutes%/60</waterCoachExternalForecastDelayHours>
        <timeZoneOffset>+01:00</timeZoneOffset>
        <dateTimePattern>yyyyMMdd HH:mm</dateTimePattern>
         <attribute id="test">
            <text>%test%</text>
        </attribute>
        <attribute id="DESC">
            <text>%description%</text>
        </attribute>
      <attributeFile>
         <csvFile>moduleInstanceDescriptors_attributes.csv</csvFile>


         <id>%ID%</id>


         <attribute id="EXTERNAL_ID">


            <text>%EXTERNAL_ID%</text>


         </attribute>


      </attributeFile>


   </moduleInstanceDescriptorsCsvFile>


</moduleInstanceDescriptors> 


ModuleInstanceDescriptors.csv located in MapLayerFiles config directory can be as simple as:

ID, test
import, a
sobek, b
archive, c

ModuleInstanceDescriptors_attributes.csv located in MapLayerFiles config directory
ID, EXTERNAL_ID
import, A
sobek, B
archive, C




...