What

Required

Description

schema location

ModuleInstanceDescriptors.xml

yes

Definition of instances of modules

https://fewsdocs.deltares.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).

When available on the file system, the name of the XML file for configuring the ModuleInstanceDescriptors is for example:

ModuleInstanceDescriptors 1.00 default.xml

ModuleInstanceDescriptors       Fixed file name for the ModuleInstanceDescriptors configuration

1.00                                            Version number

default                                       Flag to indicate the version is the default configuration (otherwise omitted).


Figure :  Root elements of the ModuleInstanceDescriptors configuration

ModuleInstanceDescriptors

ModuleInstanceDescriptors contains two elements, 

Each of these two elements can be repeated and can be in any order. 

ModuleInstanceDescriptor

One of the element of the ModuleInstanceDescriptors. For each module there is one ModuleInstanceDescriptor. 

Attributes;

description

Optional description. Used for reference purposed only.


updateModuleRunTimesOnCompletion

Since 2021.01. When true run time statistics in ModuleRunTimes Table are updated for this module instance when the module instance is completed. These run times make it possible to predict when data becomes available the next time the workflow is executed

moduleId

Reference to the ModuleDescriptors defined in the SystemConfiguration to identify the type of module. Since Delft-FEWS Version 2013.02 this element is optional. The Module type is recognized from the Module Config file.

simulatedHistoricalModuleInstanceId

When given the relation is made between the module and (simulated historical) Module Instance given here.  
The simulated historical update run, current at the moment the forecast is created, will be used for data before the start of the forecast.
When different parameters are used for the forecast and historical period it is also required to specify the historical parameter for the forecast parameter
When configured this module instance can only be used for simulated forecast time series.

ModuleInstancegroup

Another element of the ModuleInstanceDescriptors. Here you group all modules under a common ModuleInstance.  When a Module is defined in one group it cannot be defined in another group.

Attributes;


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.




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. If number format is expected, the reference may also include calculations, as is done in the example for the waterCoachExternalForecastDelayMinutes column.
Example:


<?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 https://fewsdocs.deltares.nl/schemas/version1.0/moduleInstanceDescriptors.xsd" version="1.0">
   <moduleInstanceDescriptorsCsvFile>
        <file>moduleInstanceDescriptors.csv</file>
        <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