Versions Compared

Key

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

Image Added

 

Polish

Jeśli masz problem ze zrozumieniem jak działa zadanie zaplanowane, sprawdź opis: Zadanie zaplanowane

Panel
bgColorwhite
titleBGColorlight
titlePodstawowe informacje

Pakiet: com.suncode.plugin.scheduled_tasks.RewriteDataFromDatasourceToDb

Dostępna od wersji: 1.0.1

Panel
bgColorwhite
titleBGColorlight
titleWymagania

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

Panel
bgColorwhite
titleBGColorlight
titleOpis

Zadanie zaplanowane pozwalające na przepisanie danych ze źródła danych do bazy danych. Źródło może zostać wywołane z parametrami podanymi w Zadaniu Zaplanowanym. Jako wartość parametru wywołania oprócz stałych wartości można użyć znaczników czasowych.

Panel
bgColorwhite
titleBGColorlight
titleParametry konfiguracyjne
Nazwa parametruTyp parametruOpisUwagi i ograniczenia
Id źródła danych*Tekst Id źródła danych, z którego dane zostaną przepisane. 
Nazwa bazy danych*Tekst

 

 

Nazwa bazy, w której dane zostaną zapisane.

Alias bazy DBExplorera.
Nazwa schematu w bazie danych*Tekst Schemat w bazie danych, w którym znajduje się tabela docelowa.

 

Nazwa tabeli*Tekst Nazwa tabeli, w której zostaną zapisane dane. 
Mapowanie parametrów*Tekst  

Mapowanie parametrów wyjściowych źródła na odpowiadające nazwy kolumn z tabeli z bazy danych.

Wzór mapowania parametrów:

<parametrŹródła>=<kolumnaTabeli>

Kolejne mapowania powinny być rozdzielane za pomocą przecinka np.

<parametrŹródła1>=<kolumnaTabeli1>,<parametrŹródła2>=<kolumnaTabeli2>

Typ synchronizacji*Tekst  
KluczTekst  
Typ synchronizacji danych.

Do wyboru są następujące rodzaje:

  • insert- tylko dopisuje,
  • overwrite- usuwa wszystkie rekordy i dodaje nowe,
  • upsert- dopisz lub zaktualizuj, jeżeli wartość podana w parametrze "Klucz" już istnieje.
KluczeTekstKlucze, których wartości będą sprawdzane przy typie synchronizacji "upsert". Możliwość podania większej liczby kluczy po przecinku.Kolejne klucze powinny być rozdzielane za pomocą przecinka np. klucz1,klucz2,klucz3
Parametry źródła danychTekstParametry, z jakimi zostanie wywołane źródło danych. Możliwość używania tagów czasowych. np: {current_YYYY}-{current_MM}-{current_DD} postawi aktualną datę w formacie yyyy-MM-dd.

Wzór przekazywania parametrów:

<parametrŹródła>=<wartość>

Kolejne mapowania powinny być rozdzielane za pomocą przecinka np.

<parametrŹródła1>=<wartość1>,<parametrŹródła2>=<wartość2>

Warunek zapisu danych
TekstWarunek zapisu danych (zapisany w JavaScript), który musi zostać spełniony, aby kontynuować przetwarzanie danych zwróconych ze źródła.

Przykład:

Załóżmy, że parametrem wyjściowym źródła jest "statusCode". Możemy np. kontynuować przetwarzanie danych jeśli statusCode jest pomiędzy 200 a 300:

Code Block
languagejs
 statusCode >= 200 && statusCode <= 300

Jeśli statusCode zwracany przez źródło składa się z więcej niż jednego elementu i chcemy
przetworzyć całą listę, możemy zastosować bardziej rozbudowany warunek.
Ten warunek będzie uwzględniał wszystkie elementy listy.

Code Block
languagejs
function condition(){
var condition = true;
for (var i = 0; i < statusCode.length; i++) {
  if (statusCode[i] < 200 || statusCode[i] > 300) {  
    condition = false;
  } 
}
return condition;
}
condition();

Możemy dowolnie łączyć różne parametry oraz wartości, pamiętając, żeby wynik naszych operacji miał wartość logiczną.

Parametr*- pole wymagane

 

 

 

English

← Return to the list of available setters

← Return to the list of available applications 

TAGI Możliwe do użycia w parametrze wejściowych źródła
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
Warning

Dane ze źródła danych nie zostaną pomyślnie zapisane w tabeli w bazie danych, jeżeli zwrócone wartości nie są zgodne ze zdefiniowanymi typami kolumn tabeli.

Panel
bgColorwhite
titleBGColorlight
titlePrzykładowa konfiguracja

Image Added

English
Info

If you have trouble understanding how the action works, check the descriptions: Application, Setter, Conditional execution, Component parametersdescriptionScheduled task

Panel
titlebgColorBasic informationwhite

Category:

Action location:

Available from version:

Panel
titleDescription

 

Panel
titleBGColorlight
titleDescription

A scheduled task that allows you to rewrite data from a datasource to a database. Datasource can be invoked with input parameters specified in Scheduled Task definition. Input parameters can use time and date placeholders (see tag table below).

Panel
bgColorwhite
titleBGColorlight
titleRequirements

One or more defined data sources that enable the data read operation.

Panel
bgColorwhite
titleBGColorlight
titleConfiguration parameters
Name of the parameterParameter typeDescriptionNotes and restrictions
Domain nameDatasource id*TextDomain we are trying to connect toId of the datasource from which the data will be rewritten. 
Base DNDatabase name*TextA Distinguished Name (DN) represents a signle object or whole container in hierarchical directory, at which the DN is written from lower to higher hierarchical levels from left to right e.g. CN=John Smith, OU=consultants. The DC values (Domain Component) have to be skipped in this parameter. 
Import filter*TextImport filter allows to enter criteria to narrow down the search results for objects in the domain. Objects are selected based on the entered attribute values of the objects in the filter

Filter syntax:

(attribute operator value)

 

Atrybuty:

  • cn (user common name),
  • sn (surname),
  • telephoneNumber,
  • l (localization),
  • objectCategory,
  • objectClass.

 

Operatory:

  • = (Equality),
  • \>= (Greater than or equal to),
  • <= (Less than or equal to),
  • =* (Presence),
  • ~= (Approximate),
  • & (AND),
  • | (OR),
  • ! (NOT).

 

Przykłady użycia:

  • (cn=John Smith) returns object, which common name "John Smith",
  • (ObjectClass=*) returns all objects,
  • (&(objectCategory=person)(objectClass=user)(!(cn=John Smith))) zwraca wszystkich użytkowników oprócz użytkownika "Jan Nowak",
  • (sn=sm*) returns all objects with a surname that starts with "sm",
  • (&(objectCategory=person)(objectClass=contact)(|(sn=Nowak)(sn=Kowalski))) returns all contacts with a surname equal to "Smith" or "Johnson".
Default group*TextName of the group to which the users will be assgned if the Add to default group parameter is set to true 
Add to default group*TextDetermines if users have to be added to the specified default group.Enter a boolean value of true or false in the field.
Add to LDAP group*TextUsers will be assigned to the groups on the system that are assigned to them on the LDAP server.Enter a boolean value of true or false in the field.
Create unexisted groups*TextDetermines whether to create groups in the system to which the users imported from the LDAP server belong to. If the option is set to false, the user will be added to the default group if there is no group in the systemEnter a boolean value of true or false in the field.
Synchronize*TextSpecifies if the data on the LDAP server should also be changed on the system after updating. Data update concerns adding, deleting or modifying a user.Enter a boolean value of true or false in the field.
Deactivation of users in selected groups*TextIt allows the deactivation of users in the system belonging to at least one of the groups listed in this parameter. This parameter is important only when the Synchronize parameter is set to true. If there are users in the system that do not exist any longer on the LDAP server, then after running a scheduled task with set synchronization and no indication of user groups to which these users belong, they will not be removed from the system.Enter group names after the semicolon.
Default user*TextDetermining to which user will be assigned substitutions, reports, tasks, views of the deactivated user. If the <superior> value is specified, the user's bindings will be transferred to his superiors, and if the user has no defined superiors, the bindings will go to the system administrator. If the field is left blank, the connections will go to the system administrator. 
Excluded groups*TextGroup names from which a user cannot be removed, even if he is no longer assigned to such a group on the LDAP server. This parameter is relevant only when the Synchronize parameter is set to true.Enter group names after the semicolon.

Parameter*- required field

Panel
titleSample configuration

Image Removed

Panel
titleSample configuration

A sample configuration of the LDAP server in the system that allows to perform a scheduled task with completed parameters as above looks as follows

Image Removed

Image Removed

The name of the database where the data will be saved. 
Schema name in database*TextThe schema in the database where the target table exists. 
Table name*TextName of the table in which the data will be saved. 
Parameters mappings*TextMapping the output parameters from data source to the corresponding column names from the database table.

Parameter mapping formula:

<dataSourceParameter>=<TableColumn>

Subsequent mappings should be separated by a comma, e.g.

<dataSourceParameter1>=<TableColumn1>,<dataSourceParameter2>=<TableColumn2>

Synchronization type*TextData synchronization type.

The following types are available:

  • insert (only adds),
  • overwrite (removes all records and adds new ones),
  • upsert (add or update, if the value given in the "Key" already exists).
KeysTextThe key value of which will be checked with the "upsert" synchronization type.  Possibility of specifying multiple comma-delimited keys.Successive keys should be separated by a comma, e.g. key1,key2,key3
Datasource parametersTextDatasource input parameters. Example time and date tag usage: {current_YYYY}-{current_MM}-{current_DD} - will insert current date (format: yyyy-MM-dd).

Input parameters pattern:

<datasourceParam>=<value>

Each subsequent input parameter should be separated by comma e.g.

<datasourceParam1>=<value1>,<datasourceParam2>=<value2>

Save data condition
TextSave data condition written in JavaScript that needs to be met in order to process datasource response.

Example:

Let's assume that "statusCode" is one of the datasource's output parameter. We can condition further processing by specifing that it's value should be between 200 and 300:

Code Block
languagejs
statusCode >= 200 && statusCode <= 300

We can mix and match different datasource parameters and values keeping in mind that the result must be a boolen type.

Parameter*- required field

Warning

Data from the data source will not be successfully written to the database table if the returned values do not match the defined table column types.

Panel
bgColorwhite
titleBGColorlight
titleSample configuration

Image Added