Artikel: AN0001772Aktualisiert: 13.11.2020
System ObjectGears data can be also obtained by means of imports. Import can created and modified by the IT owner of a model or administrator. Access right to run the import can then be assigned to a user role and linked e.g. to a button.
Import created in this way is an ObjectGears object of data type Import. Therefore, we can work with it further in several ways:
- within user interface (jobs, workflow, rules etc.)
- by means of scripts
- by means of web services
- by means of URL call
There one special type of import - import into the internal class with users. This import can be created and run only by Administrator.
Scripts
Process of import can be influenced by means of procedures, scripts and workflow. Scripts and procedures can be executed in four moments during the import. These scripts and procedures are used for an easy control of the processed data in form of check or modification of data (conversion, trimming etc.). Basic import cannot handle all these needs which is the reason why this extension is in place.
After the import workflow can be started. This can ensure further processing of just imported data.
You can use following properties in executed scripts:
Object |
Description |
Import OGActualImport |
Import that is executed. |
ImportRun OGActualImportRun |
Currently executed import instance. |
string OGActualImportDbTable |
Name of the auxiliary database table for data import. |
OG |
Common object for scripts. |
During import are data stored and processed in an auxiliary import table (OGActualImportDbTable). This table is created for each import instance and it is dropped after import termination. In this table you change data during the import. Before import termination these data are moved to the appropriate table of the target class (DataRow___).
Import data format
Data import can be performed from two data formats. One of the is CSV, the other is XML. Use of one or another depends on your data source and possibilities of their creation (export from another system). This format is not significant from the import point of view. Both of them work in the same way once correctly configured.
Obligatory columns
In case of import into the internal class Person ObjectGears enforces import into all the obligatory columns.
In case of import into a class created by user column obligation is not enforced. This is an intended ObjectGears feature providing an extra flexibility for solving various situations. However, this feature has to be remembered, because it enables potenitially to disturb data integrity ensured by the column obligation. The designer of the import is responsible for considering import impact and consequences.