Skip to end of metadata
Go to start of metadata

 

Basic information

Package: com.suncode.plugin.scheduled_tasks.RewriteDataFromFIlesToDatasources

Available from version: 1.0.X

Requirements

One or more defined data sources for the data read operation and one or more defined data sources for the data write operation.

Description

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.

Configuration parameters
Parameter namefrom versionDescriptionThe type of the parameterNotes and Restrictions
Catalog1.0.XThe path to the root directoryString 
File name [Regexp]
1.0.XFinds only files matching the given regular expressionString

Regular expression. To test regular expressions, you can use the website: https://regex101.com/

Scan subdirectories1.0.X'true' - I also search all subdirectories in the selected directory, "false" - only searches the current directory.BooleanTo set the parameter, enter the text "true"
Delete processed files1.0.X'true' - deletes the read file after it has been processed, "false" - files remain on diskBooleanTo set the parameter, enter the text "true"
First Source Id1.0.XId of the source from which the data will be retrievedString 
First source parameter values1.0.XA JSON object containing the input configuration of the first data source. Format {"inputParameterID": "Value"}StringThe possibility of using tags. Table below
Second source Id
1.0.XId of the source where the data will be enteredString 
Source parameters mapping1.0.XJSON 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 values1.0.XA JSON object containing the input configuration of the second data source. Format {"InputParameterID": "Value"}StringThe 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!

MarkerDescriptionComments
Information about the processed file
{fileName}The full name of the fileExample: file.txt
{baseFileName}

File name without extension

Example: file
{fileExtension}File extensionExample: txt
{directoryPath}Directory pathExample: / home / user / dir /
{filePath}The full path to the file

Example:
/home/user/dir/plik.txt

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)

Sample configuration

Change log

1.0.X (applicable documentation)

  • Create a scheduled task

  • No labels
Write a comment…