Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleExample setCurrentFileNameProperty
<runInLoopActivityRunner id="runInLoop">
            <activities>
               
<!— This CopyActivity will copy all XML files form the Import/aquo directory. However because 
The activity is being run in a loop each file will be copied individually. By setting the property 'setCurrentFileNameProperty' the name of the file being copied will be mapped to the key CURRENT_FILENAME. This key can then be used by the other activities as shown below. -->
 
                <copyActivity id="loopedCopy">
                    <srcFilePath>%REGION_HOME%/TestData/Import/aquo/*.xml</srcFilePath>
                    <destFilePath>$IMPORT_FOLDER_ROOT$/aquo/</destFilePath>
                   <setCurrentFileNameProperty>CURRENT_FILENAME</setCurrentFileNameProperty>
                </copyActivity>
                <moveActivity id="loopedMove">
                   <srcFilePath>$EXPORT_FOLDER_ROOT $/aquo/*</srcFilePath>
                   <destFilePath>$BACKUP_FOLDER_ROOT$/aquo/$CURRENT_FILENAME$.xml</destFilePath>
                </moveActivity>
                ...


Figuur Figure 6 DataConversion copy activity

...

  • description:      optional information
  • workflowId:      id of workflow to be run

 

Figuur Figure 7 DataConversion workflow activity

...

  • id:                    required idendifier.
  • description:      optional information
  • srcFilePath:      path to files that are to be copied. Wildcards accepted.
  • destFilePath:    path to destination directory. No wildcards allowed.
  • setCurrentFileNameProperty: option that sets the name of the file currently being moved as a global property. This property can then be accessed by other activities. This option only works when this activity is nested in a ‘runInLoopActivityRunner’ activity.

Figuur Figure 8 DataConversion move activity

...

  • id:                    required idendifier.
  • description:      optional information
  • importStatusPath: path to the directory in which status file is to be generated.
  • dataFeedId:     option to filter the ‘dataFeedId’ values that are to be exported to file. If omitted all available datafeed information will be exported.

Figuur Figure 9 DataConversion import status

...

  • id:                    required idendifier
  • description:      optional information
  • activities:          list of activities over which to loop
  • timeOutSeconds: option timeout in seconds after which looping is terminated.

 

Figuur Figure 10 DataConversion run in loop activity

...

Configuration of DCM: conversion task variants

 

Variant 1: Import, Export.

 

Image Added

Figure 11 Simplest workflow variant in DCM. The DCM is only used for conversion of the file format, there is no need for transformations. 

 

Note (1): If you need to use LocationSets.xml for transformations than it is also necessary to add a Locations.xml to your Config/RegionConfigFiles folder. 

Note (2): If you need to use IdMapping or Unitconversion than it is necessary to add a Parameters.xml to your Config/RegionConfigFiles folder.

 

Code Block
titleTimeSeriesImportRun in DCM
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
	<import>
		<general>
			<importType>LmwWeatherdata</importType>
			<folder>$IMPORT_FOLDER_ROOT$/LMW_maasaa</folder>
			<idMapId>IdImport_LMWmaasaa</idMapId>
		</general>
		<temporary>true</temporary>
	</import>
</timeSeriesImportRun>
Code Block
titleTimeSeriesExportRun in DCM
<timeSeriesExportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews
http://fews.wldelft.nl/schemas/version1.0/timeSeriesExportRun.xsd">
	<export>
		<general>
			<exportType>NETCDF-CF_TIMESERIES</exportType>
			<folder>$EXPORT_FOLDER_ROOT$/LMW_maasaa</folder>
			<exportFileName>
				<name>_LMWmaasaa.nc</name>
				<prefix>
					<timeZeroFormattingString>yyyy-MM-dd'T'HHmmss</timeZeroFormattingString>
				</prefix>
			</exportFileName>
			<unitConversionsId>ExportUnitConversions</unitConversionsId>
			<exportMissingValueString>-9999.0</exportMissingValueString>
			<exportTimeZone>
				<timeZoneOffset>+01:00</timeZoneOffset>
			</exportTimeZone>
		</general>
		<properties>
			<bool value="false" key="includeFlags"/>
			<bool value="false" key="includeComments"/>
		</properties>
		<metadata>
			<title>Export of LMW_maasaa datafeed</title>
			<institution>Deltares</institution>
			<history>Exported at time zero = %TIME_ZERO(yyyy/MM/dd HH:mm:ss z)% in module instance %MODULE_INSTANCE_ID% as part of workflow %WORKFLOW_NAME% by user %USER_ID%.</history>
			<comment>The actual time of writing was %CURRENT_TIME(yyyy-MM-dd HH:mm:ss z)%</comment>
		</metadata>
	</export>
</timeSeriesExportRun>

 

 

Variant 2: Import, Transformation, Export.

Image Added

Figure 12 Using Transformation functionality to change timeseries. 

 

 

Variant 3: Import, (dis)Aggregation, Export.

Image Added

Figure 13 This construction is needed whenever functionalities are used that need data from previous DCM runs. The extra export/import routine ensures that the user has data from previous DCM runs.  

 

 

 

Run the DCM 

The DCM can be executed as a script from the command line or as a scheduled task (see Figure 2 for the location of these files).

...