Automatic data exchange using the "Universal XML Data Exchange" processing, without changing the configuration. Universal data exchange in XML format

When maintaining several working 1C databases, sometimes there is a need to exchange data between them. There are 2 ways to transfer data:

  1. Data transfer using exchange and processing rules “Exchange XML data" Exchange rules are created using the 1C:Data Conversion configuration.
  2. Transferring data between similar infobases using the “Uploading and loading XML data” processing.

Let's consider the second option, i.e. uploading and loading data from/to configurations that contain the same (identical) objects we need. To do this, we will use the external processing “Uploading and loading XML data”, which can be used.

The condition for using this processing is as follows: The information base from which data is downloaded must contain the same objects and with the same details (name and data type) as in the database into which the data is loaded.

Let's consider an example with data transfer using this processing. Suppose you need to transfer the documents “Incoming payment order” and “Outgoing payment order”. The solution to this problem will be as follows.

We open the external processing “Uploading and loading XML data” through the main menu: File? Open... On the “Upload” tab, indicate XML file, into which we will save the data.

Then you need to specify the period for which we will unload data objects from the 1C database and the objects themselves. We mark the documents we need for uploading with a tick in the configuration object structure field in the “Data for uploading” column. If the uploaded documents contain links to directory elements that are not in another configuration, then it makes sense to check the boxes in the “If necessary” column so that these elements are also uploaded along with the documents.

Now on this step Do you need to decide whether to upload their movements along the registers along with the documents or transfer these documents to another database? To re-post uploaded documents in another database, you can use the processing “ Batch Processing reference books and documents." If the algorithms carried out in the data information databases differ in some way, then the checkbox next to “Upload all its movements with the document” should not be checked.

That's all, the upload setup is complete, everything is simple here! Click the “Upload data” button and wait until the data is saved to an XML file. For more complex unloadings, you can specify selection for unloaded objects not only by period.

After unloading, go to the second 1C database and open the same processing there. Go to the “Download” tab and indicate here the same XML file into which we uploaded the data.

On this tab, check the box next to “Continue loading objects if an error occurs” and click on the “Load data” button. We do not consider other functions, for example, the use of totals, although this function can significantly speed up the loading of objects (records by registers).

What is needed for automatic exchange data, without making changes to the configuration:
1) Processing "Universal data exchange in XML format" , which is included in most standard configurations. If it is not there, then it is easy to find it on the ITS disk or on the Internet. In the configuration it is called "Universal XML Data Exchange"
2) Data exchange rules. Created using "Data Conversion". A job that you will have to master. There are also video courses and teaching aids. For example: http://programmist1s.ru/wp-content/uploads/2013/06/Konvertatsiya_dannyih._Metodika_rabotyi_i_primeryi.pdf
3) External processing, containing loading/unloading procedures. Let's start creating it:
An external processing is created in the object module which will contain the text below (substitute your data for databases and users). It is advisable to create a separate user with full rights for data exchange. Let's call the processing, for example, "Data Exchange.epf".

If LaunchParameter = "Upload" Then Processing=Processing.UniversalXMLDataExchange.Create(); //Set the parameters necessary for uploading (optional for editing) Processing.ExchangeMode="Upload"; refilled //If we upload the data to a file If Not Processing.DirectReadingVIBReceiver Then Processing.ExchangeFileName = "C:\Inbox\OlegA\Conversion\upload.xml";

//If we upload the data to the database Otherwise Processing.PasswordInformationBaseForConnection="Admin"; Processing.ConnectionInfoBaseUser="supercool";

Processing.AuthenticationWindowsInformationBaseForConnection=False;
"C:\Program Files (x86)\1cv82\common\1cestart.exe" ENTERPRISE /F"C:\Inbox\KBF\1Cv8_Base_8.1\Zeus 83 BP3\Zeus 83 BP3" /N"Data Exchange Robot" /P"pass " /DisableStartupMessages /RunModeManagedApplication /Execute"C:\Inbox\OlegA\DataExchange.epf" /C"Upload"
Explanations:

b) C:\Inbox\KBF\1Cv8_Base_8.1\Zeus 83 BP3\Zeus 83 BP3 - your path to the file database from which we will upload data
c) Data Exchange Robot - User name under which 1C runs for data exchange
d) pass - user password
e) /DisableStartupMessages - close pop-up windows when starting 1C
e) /RunModeOrdinaryApplication - launch in normal mode fat client
g) C:\Inbox\OlegA\Data Exchange.epf - the path to our processing, which will start at startup
h) Upload - we pass the 1C launch parameter, it tells us that we need to upload data

If the database is server-based:
"C:\Program Files (x86)\1cv82\common\1cestart.exe" ENTERPRISE /S"Server1C/DataBase" /N"Data Exchange Robot" /P"pass" /DisableStartupMessages /RunModeManagedApplication /Execute"C:\Inbox\Oleg\ Data Exchange.epf" /C"Upload"
Explanations:
a) C:\Program Files (x86)\1cv82\common\1cestart.exe - your path to the 1C starter
b) Server1C/DataBase - your server on which the database is located and the name of the database itself from which we upload data.
The remaining parameters are similar to the file version of the bat file

5) Bat file download (if necessary). If you decide to upload data to a file and not directly to the database. Then we will also need this item (usually necessary).
Creation bat file upload is similar to the upload file, but only the launch parameter is different, instead of “Upload”, we put “Download”

6) Set a launch schedule our Bat files loading/uploading on the server. To do this, you need to go to the administration of the control panel on the server and in the task scheduler create a new task to run the download file at 23 o'clock every day and a download task specifying the Bat download file (if necessary) at 04 o'clock for example.

Quite often in the work of large enterprises and retail chains there is a need to exchange data between databases. Each programmer and administrator solves this issue differently. Some write uploads and downloads through intermediate table files, others use the mode COM connections to connect to the source base. However, in Lately 1C’s own mechanism called “Universal Data Exchange in XML Format” is gaining more and more popularity.

Appearance of processing

In the Full interface, you can open processing at Service->Other data exchanges->Universal data exchange in XML format.

The processing form (Fig. 1) contains four tabs:

  • Additional settings;
  • Deleting data.
  • The interface of each of the tabs is heavily loaded with elements and therefore requires separate consideration.

    Uploading data

    At the very top of the tab there is a field for selecting an exchange rules file. For non-standard databases and exchanges, you will have to create the exchange file yourself.

    On next line The form contains two switches:

    1. Uploading to an exchange file (Fig. 2);
    2. Connecting and uploading data to information security (Fig. 3).

    As you can see from the above pictures, it differs depending on the switch. appearance forms. If the file sharing option is selected, the user is prompted to select the location of the file where it will be uploaded and the possibility of compressing it to save space and protect it with a password.

    The option of direct connection to the receiving base supports both file and client-server modes of operation. In this case, you will need to enter the database address and fill in the “User” and “Password” fields. Before you start exchanging data, it is advisable to test the connection.

    Tabular part located below allows you to configure selections and other unloading parameters.

    To debug algorithms and correct errors, you can use the mechanism built into exchange processing. It is activated by checking the corresponding checkbox at the bottom of the form. Clicking on the “Debugging settings…” button brings up a window (Fig. 4).

    Fig.4

    Distinctive feature of this form is an informative help sheet on the left side of the layout that describes each of the three possible modes debugging As a file external processing Any file in epf format can be used with the module.

    Clicking on the “Finish” button checks the correctness and completeness of the filled in data.

    Unlike “Upload,” this tab (Fig. 5) does not have a tabular part, but there are many more checkboxes that allow you to adjust the parameters for recording new and changed objects.

    Fig.5

    First of all, you need to select a file that will serve as a source of information. This can be done in the “File name to upload” input field. If the data was uploaded to a password-protected archive, it will need to be entered in the appropriate field.

    The corresponding checkboxes allow you to configure:

    • Transaction when writing objects (this sometimes speeds up the process);
    • Loading data in exchange mode (in this case, all platform checks, with the exception of checking when posting documents, will be ignored when recording);
    • Overwriting changed elements;
    • Setting a deletion mark for downloaded items;
    • The mode of writing new data to the register (either one at a time or in a set);
    • Trimming of insignificant characters (spaces and tabs) for string values.

    Additional settings

    As the name of the bookmark implies, it contains tools, the use of which allows you to more accurately customize the exchange process. In particular:

    1. Enables debugging mode;
    2. Allows the use of a transaction during the unloading process;
    3. Optimizes exchange between databases of version 8 of 1C;
    4. Upload only those objects that are allowed for use by the current user;
    5. Enable logging of the exchange process between databases.

    These and some other functions are enabled by checking the appropriate boxes on the form (Fig. 6).

    Fig.6

    Deleting data

    This tab is only used by developers in debug mode. Allows you to remove unnecessary objects from the database.

    Briefly about setting up exchange rules

    Using a standard handler greatly simplifies life for programmers. At the same time, one of the most difficult moments for someone who first encountered “Universal Data Interchange in XML Format” is the question: “Where can I get the exchange rules file?”

    First of all, for self-made exchange rules, a special configuration is required, which is called “Data Conversion”. It contains several interesting files, which allow you to configure almost any exchange between various 1C databases 7 and 8 versions:

    1. epf – required for downloading the metadata structure for 1C 8 databases;
    2. epf – if the 1C 8 configuration is self-written or not standard, it may not have the “Universal Data Exchange” processing, this file is this processing;
    3. ert – file contains code for downloading the metadata structure of configurations of 1C versions 7.7;
    4. ert – file for processing data upload and download for the seven.

    Having launched the appropriate processing, it is necessary to unload the metadata structures for the source and destination databases. Then, in the “Conversion” configuration, you need to enter information about the source and destination configurations into the “Configurations” directory.

    Then an element is created in the Conversion directory containing information about the direction of data exchange. You can set up Exchange Rules for it.

    Parameter name Meaning
    Article topic: Data exchange in XML format
    Rubric (thematic category) Technologies

    A DBMS can support data exchange in XML format in a very simple form - supporting the output of query results and the input of data for the INSERT statement in XML format. However, this requires the user or programmer to carefully design the format of the generated query results so that it exactly matches the format of the INSERT statement in the receiving database. XML data exchange should only be truly useful if it is more explicitly supported by the DBMS.

    Today, several commercial products offer the ability to batch export tables (or query results) to external file, formatted as an XML document. However, they offer a similar ability to batch import data from a file of the same type into a DBMS table. This schema makes XML standard format representation of the contents of tables for data exchange.

    Please note that the use of the capabilities offered by the DBMS for importing/exporting table data in XML format does not limit their use for exchange between databases.

    Data exchange in XML format - concept and types. Classification and features of the category "Data exchange in XML format" 2017, 2018.

  • - XML ​​grammar

    XML Markup Language Markup Languages ​​Markup text allows you to easily analyze and process text. It includes: · text carrying semantic information (infoset);


  • · markup indicating the structure of the text.

    Markup language is designed to... . - HTML and XML versions and extensions First version of the language hypertext markup– HTML (HyperText Markup Language), the same as itself Web technology, was developed by Tim Berners Lee in 1991. The HTML language is an application of SGML for a document type that has been called


  • HTML documents

    . The language specifies a fixed structure... . - XML ​​language XML (Extensible Markup Language) is a markup language that describes a class of data objects called XML documents. The XML language is used as a means to describe the grammar of other languages ​​and control the correctness of documents /6/.


  • Unlike

    HTML language XML allows 1.... .- XML ​​document structure


  • -

    Defines an event handler that occurs whenever the object's state changes. The name must be written in lowercase. The readyState property of the XMLHttpRequest object. The readyState property defines


  • Current state

    XMLHttpRequest object.

    The table shows the possible values... . - The onreadystatechange property of the XMLHttpRequest object. Defines an event handler that occurs whenever the object's state changes. The name must be written in lowercase.