Package: com.suncode.plugin.scheduled_tasks.RewriteDataFromFIlesToDatasources
Available from version: 1.0.X
One or more defined data sources for the data read operation and one or more defined data sources for the data write operation.
The task searches for matching files for a pattern. The data from the file is read through the first source and written to the second source. You can call each source with constants or with special tags. These values are in text format, please ensure compatibility in the source configuration. The source rewriting mechanism uses the "Rewrite data between sources" scheduled task principle (You do not need to configure this task separately). After the found file has been processed, you can enable the automatic option to delete it. When an incorrect file processing is encountered (e.g. incorrect source configuration for the selected file), the task will go to the next file and finally display the list of errors in the scheduled task logs and the task summary.
Parameter name | from version | Description | The type of the parameter | Notes and Restrictions |
---|---|---|---|---|
Catalog | 1.0.X | The path to the root directory | String | |
File name [Regexp] | 1.0.X | Finds only files matching the given regular expression | String | Regular expression. To test regular expressions, you can use the website: https://regex101.com/ |
Scan subdirectories | 1.0.X | 'true' - I also search all subdirectories in the selected directory, "false" - only searches the current directory. | Boolean | To set the parameter, enter the text "true" |
Delete processed files | 1.0.X | 'true' - deletes the read file after it has been processed, "false" - files remain on disk | Boolean | To set the parameter, enter the text "true" |
First Source Id | 1.0.X | Id of the source from which the data will be retrieved | String | |
First source parameter values | 1.0.X | A JSON object containing the input configuration of the first data source. Format {"inputParameterID": "Value"} | String | The possibility of using tags. Table below |
Second source Id | 1.0.X | Id of the source where the data will be entered | String | |
Source parameters mapping | 1.0.X | JSON object containing mapping of output parameters of the first source with input parameters of the second source (in the format {'x': 'y', ...}, where x - id of the output parameter of the source from which the data will be retrieved; y - id of the input source parameter where the data will be entered) | String | |
Second source parameter values | 1.0.X | A JSON object containing the input configuration of the second data source. Format {"InputParameterID": "Value"} | String | The possibility of using tags. Table below |
Important!
In order for the markers to work properly, in the scheduled task configuration, select the option responsible for saving the execution history!
Marker | Description | Comments |
---|---|---|
Information about the processed file | ||
{fileName} | The full name of the file | Example: file.txt |
{baseFileName} | File name without extension | Example: file |
{fileExtension} | File extension | Example: txt |
{directoryPath} | Directory path | Example: / home / user / dir / |
{filePath} | The full path to the file | Example: |
Time of scheduled task execution | ||
{current_timestamp} | thirteen digit number of milliseconds since 01/01/1970 (timestamp) | |
{current_DD} | two-digit number representing the day of the month | |
{current_MM} | two-digit number representing the day of the month | |
{current_YY} | a two-digit number representing the year | |
{current_YYYY} | a four-digit number that represents the year | |
{current_hh} | a two-digit number representing the hour | |
{current_mm} | a two-digit number representing the minutes | |
{current_ss} | a two-digit number representing the seconds | |
{current_nnn} | trzycyfrowa liczba reprezentująca nanosekundy | |
Czas ostatniego wykonania zadania zaplanowanego | ||
{timestamp} | thirteen digit number of milliseconds since 01/01/1970 (timestamp) | |
{DD} | two-digit number representing the day of the month | |
{MM} | two-digit number representing the day of the month | |
{YY} | a two-digit number representing the year | |
{YYYY} | a four-digit number that represents the year | |
{hh} | a two-digit number representing the hour | |
{mm} | a two-digit number representing the minutes | |
{ss} | a two-digit number representing the seconds | |
{nnn} | trzycyfrowa liczba reprezentująca nanosekundy |
Example
Defining the "Source parameter values" parameter as {"last_call_date": "{YYYY} - {MM} - {DD} {hh}: {mm}: {ss}. {Nnn}"}
The following will be sent to the source: {"last_call_date": "2020-11-09 20: 09: 15.032"} (the values of the last valid execution date of the scheduled task will be automatically taken from the database; in the case when the task is run for the first time , the date of 01.01.1970 will be adopted)
1.0.X (applicable documentation)
- Create a scheduled task
Add Comment