Batch module, Executes Definition sets automatically and at scheduled times
The batch module is ideal for a Definition conversion process that takes a long time to run or for frequently repeated tasks. Examples of these are the Import / Export / Update of large databases, which can be run as an overnight batch job, and the automatic creation of a testing data during a development project.
Example command line
These parameters instruct FlowHeater to run the Definition set ImportTurnover.fhd but only process the first 1000 rows.
Note: If authorization is required to enable connection to a database ( SQL Server, Oracle, MySQL, etc.) for example, the necessary database, username and password details must be stored in the Definition set. For security reasons, all passwords saved in FlowHeater Definition sets are encrypted.
Exitcode / Errorlevel
To find out whether the execution of a FlowHeater Definition set was successful in a batch file script (.CMD / .BAT) you can test the exit code (ErrorLevel) immediately after FHBatch.exe (ErrorLevel = 0 means OK).
|/? or /help||Outputs a help description|
|/MaxRows n||At most only the first n records/rows are processed|
|/Memory||Enables the memory processing mode (only Version 2.x)
|/Massdata||Enables the mass data processing mode|
|/ShowDebug||Outputs debug messages to the shell standard output channel|
|/DisableDebug||Disables debug messages (only Version 2.x)
|/ShowWarnings||Outputs warning messages to the shell standard output channel (only Version 2.x)
|/DisableWarnings||Disables warning messages|
Options only for TextFile and Excel Adapter
||Overrides the default in the definition file
Version 2.x only:Wildcards like C:\Temp\*.csv are allowed!
||Overrides the default in the definition file|
As of version 2.x all the options you selected using Designer in the Test and Execute popup are saved within the FlowHeater Definition. You only need the options detailed above when you wish to change the predefined options during batch execution.
e.g. You have a very large volume of data you wish to import/export. While you are setting up the Definition and testing it in the Designer, you select the option to process a maximum of 1000 records. This setting is nevertheless stored in the Definition file. If you now try to run this Definition using the Batch Module without making further changes, only the first 1000 records will be processed. So that the Batch Module processes the complete number of records available, you need to override the option /MaxRows with the value 0 in the task parameters. See example.
FHBatch.exe /MaxRows 0 import.fhd
This will process all available records/rows, regardless of the predefined setting in the Definition file.
Examples of usage
The batch module makes it is easy to export data on a regular basis, for example, every night you could export the day’s turnover figures into a CSV text file automatically. Further potential uses include taking flat files or test data, formatted with fixed column widths, and importing these on demand into an SQL Server database for testing purposes (a feature sure to bring a smile to your developers).