Versions Compared

Key

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

Polish
Panel
bgColorwhite
titleBGColorlight
titlePodstawowe informacje

Pakiet: com.suncode.plugin.scheduled_tasks.RewriteDataFromFilesToDatasource

Dostępna od wersji: 1.0.X

Panel
bgColorwhite
titleBGColorlight
titleWymagania

Co najmniej jedno zdefiniowane źródło danych umożliwiające operację odczytu danych oraz co najmniej jedno zdefiniowane źródło danych umożliwiające operację zapisu danych.

Panel
bgColorwhite
titleBGColorlight
titleOpis

Zadanie wyszukuję pasujące pliki do wzorca. Dane z pliku są odczytywane za pomocą pierwszego źródła i przepisywane do drugiego źródła. Można wywołać każde źródło wraz z wartościami stałymi lub z wykorzystaniem specjalnych znaczników. Wartości te są w formacie tekstowej, należy zapewnić kompatybilność w konfiguracji źródeł. Mechanizm do przepisywania źródłem wykorzystuję zasadę działania zadania zaplanowanego "Przepisz dane między źródłami" (Nie trzeba specjalnie konfigurować tego zadania osobno). Po przetworzeniu znalezionego pliku można włączyć automatyczną opcję jego usuwania. W momencie napotkania błędnego przetworzenia pliku (np. niepoprawna konfiguracja źródła dla wybranego pliku), zadanie przejdzie do następnego pliku i na końcu wyświetli listę błędów w logach zadania zaplanowanego oraz podsumowanie zadania.

Panel
bgColorwhite
titleBGColorligth
titleParametry konfiguracyjne
Nazwa parametruod wersjiOpisTyp parametruUwagi i ograniczenia
Katalog1.0.XŚcieżka do katalogu głównegoTekst 
Nazwa pliku [Regexp]1.0.XWyszukuje tylko pliki pasujące do podanego wyrażenia regularnegoTekstWyrażenie regularne. Do testowania wyrażeń regularnych można skorzystać ze strony:
https://regex101.com/
Skanuj podkatalogi1.0.X'true' - przeszukuję również wszystkie podkatalogi w wybranym katalogu, "false" - przeszukuje tylko bieżący katalogLogicznyAby ustawić parametr należy wpisać tekstowo "true"
Usuń przetworzone pliki1.0.X

'true' - kasuję odczytany plik po jego przetworzeniu, "false" - pliki pozostają na dysku

LogicznyAby ustawić parametr należy wpisać tekstowo "true"
Id pierwszego źródła1.0.XId źródła, z którego pobrane zostaną daneTekst 
Wartości parametrów pierwszego źródła1.0.XObiekt JSON zawierający konfigurację wejściową pierwszego źródła danych. Format {"idParametruWejściowego":"Wartość"}TekstMożliwość użycia znaczników. Tabela poniżej
Id drugiego źródła1.0.XId źródła, do którego wpisane zostaną daneTekst 
Mapowanie parametrów źródeł1.0.XObiekt JSON zawierający mapowanie parametrów wyjściowych pierwszego źródła z parametrami wejściowymi drugiego źródła (w formacie {'x':'y',...}, gdzie x - id wyjściowego parametru źródła, z którego pobrane zostaną dane; y - id wejściowego parametru źródła, do którego wpisane zostaną dane)Tekst 
Wartości parametrów drugiego źródła1.0.XObiekt JSON zawierający konfigurację wejściową drugiego źródła danych. Format  {"idParametruWejściowego":"Wartość"}TekstMożliwość użycia znaczników. Tabela poniżej
Warning
titleWażne!

Aby znaczniki działały prawidłowo należy w konfiguracji zadania zaplanowanego zaznaczyć opcję odpowiadającą za zapisywanie historii wykonania!

ZnacznikOpisUwagi
Informacje o przetwarzanym pliku
{fileName}Pełna nazwa plikuPrzykład: plik.txt
{baseFileName}

Nazwa pliku bez rozszerzenia   

Przykład: plik
{fileExtension}Rozszerzenie plikuPrzykład: txt
{directoryPath}Ścieżka do kataloguPrzykład:     /home/user/dir/
{filePath}Pełna ścieżka do plikuPrzykład: 

/home/user/dir/plik.txt

Czas wykonania  zadania zaplanowanego
{current_timestamp}trzynastocyfrowa liczba milisekund liczona od 01.01.1970 (timestamp) 
{current_DD}dwucyfrowa liczba reprezentująca dzień miesiąca 
{current_MM}dwucyfrowa liczba reprezentująca dzień miesiąca 
{current_YY}dwucyfrowa liczba reprezentująca rok 
{current_YYYY}czterocyfrowa liczba reprezentująca rok 
{current_hh}dwucyfrowa liczba reprezentująca godzinę 
{current_mm}dwucyfrowa liczba reprezentująca minuty 
{current_ss}dwucyfrowa liczba reprezentująca sekundy 
{current_nnn}trzycyfrowa liczba reprezentująca nanosekundy 
Czas ostatniego wykonania zadania zaplanowanego
{timestamp}trzynastocyfrowa liczba milisekund liczona od 01.01.1970 (timestamp) 
{DD}dwucyfrowa liczba reprezentująca dzień miesiąca 
{MM}dwucyfrowa liczba reprezentująca dzień miesiąca 
{YY}dwucyfrowa liczba reprezentująca rok 
{YYYY}czterocyfrowa liczba reprezentująca rok 
{hh}dwucyfrowa liczba reprezentująca godzinę 
{mm}dwucyfrowa liczba reprezentująca minuty 
{ss}dwucyfrowa liczba reprezentująca sekundy 
{nnn}trzycyfrowa liczba reprezentująca nanosekundy 
Info
titlePrzykład

Definiując parametr "Wartości parametrów źródła" jako {"data_ostatniego_wywolania":"{YYYY}-{MM}-{DD} {hh}:{mm}:{ss}.{nnn}"}

Do źródła przekazane zostanie: {"data_ostatniego_wywolania":"2020-11-09 20:09:15.032"} (wartości daty ostatniego prawidłowego wykonania zadania zaplanowanego podstawiane za znaczniki zostaną automatycznie pobrane z bazy; w przypadku, gdy zadanie jest uruchomione po raz pierwszy, przyjęta zostanie data 01.01.1970)

Panel
bgColorwhite
titleBGColorligth
titlePrzykładowa konfiguracja

Panel
bgColorwhite
titleBGColorlight
titleChange log

1.0.X (obowiązująca dokumentacja)

  • Utworzenie zadania zaplanowanego
English
Panel
bgColorwhite
titleBGColorlight
title Basic information

Package: com.suncode.plugin.scheduled_tasks.RewriteDataFromFIlesToDatasources

Available from version: 1.0.X

Panel
bgColorwhite
titleBGColorlight
titleRequirements

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

Panel
bgColorwhite
titleBGColorlight
titleDescription

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.

Panel
bgColorwhite
titleBGColorligth
titleConfiguration 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
Warning
titleImportant!

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 
Info
titleExample

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)

Panel
titleSample configuration

Panel
bgColorwhite
titleBGColorlight
titleChange log

1.0.X (applicable documentation)

  • Create a scheduled task