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

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 exchange data in XML format».

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 Any file in the epf format can serve as an external processing file for 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.

    What is needed for automatic data exchange, without making configuration changes:
    1) Processing "Universal Data Interchange 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;//If the data receiver is a server base If Processing.ConnectionInformationBaseType = False Then Processing.ConnectionInformationBaseServerName="MainServ";

    Processing.InformationBaseNameOnServerForConnection="Buhia";
    "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.

    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. Exchange XML data should 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 The first version of the hypertext markup language is HTML (HyperText Markup Language), just like 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

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


  • -

    Structure XML document includes the header, DOCTYPE section, and body of the XML document. The header describes the version and encoding. The DOCTYPE section describes entities. Entity is a constant used in the body of an XML document for shorthand and easy maintainability. In the XML body... .


  • Defines an event handler that occurs whenever the object's state changes. The name must be written in lowercase.

    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 specifies the current state of the XMLHttpRequest object. The table shows the possible values...


  • IN last years The W3C consortium (WWW Consorcium) is actively working towards a radical revision of the fundamentals of Web technologies. As a result, the XML markup language (Extensible Markup Language) was created, which is used to describe and process information... . In almost all 1C 8 configurations, there are predefined exchanges between other standard releases, for example with: "1C Trade Management 8", "1C ZUP 8", "1C Retail 8". However, what if you need to exchange between different configurations with completely different structure

    metadata? IN in this case processing “Universal Data Interchange in XML Format” will help, which can be downloaded free of charge for and

    To work with these processing, we need a rules file in xml format. It describes exactly how data from one

    • information base
    • are transferred to another. It is created using a specialized “Data Conversion” configuration, which is supplied on disk or on the ITS website. We will look at how to create it in the next article, but for now let’s imagine that we already have it. There are 4 tabs in processing. Let's look at them all in order:
    • Uploading data

    First of all, we indicate the name of the rules file on the basis of which the upload will take place.

    Specify the name of the data file in which all information will be saved.

    You can check the box: compress the received file or not. automatic download The data speaks for itself.

    Additional settings

    Tab additional settings allows you to fine-tune processing execution

    • Debugging mode allows you not to stop the upload or download procedure if any problem occurs. unexpected error. After completing the operation, a detailed report will be displayed.
    • To monitor the exchange process, you can check the “Output” checkbox information messages».
    • Number of processed objects for status update - determines the number of processed elements after which the information in the information window will be updated.
    • “Use an optimized format for data exchange (V8 - V8, processing version no lower than 2.0.18)” is a specialized format that requires the “Information ON Data Types” tag in the message header, which speeds up the execution process.
    • Use transactions when unloading for exchange plans – when this flag is set, the unloading will be performed in one transaction (an indivisible, logically connected sequence)
    • Number of elements in a transaction - determines the number of elements that will be uploaded/loaded in one transaction. If set to 0, then all the procedure will pass in one transaction. This option is recommended, since the guarantee of logical data connectivity will remain.
    • Upload objects for which there are access rights - a flag based on which objects are determined for unloading to which the current user has access rights.
    • Automatically delete Unacceptable symbols from strings to be written to XML - during installation of this paragraph all entries in the message are checked for XML 1.0 validity and characters that do not comply with the standard are removed.
    • Registration changes for exchange nodes after uploading – defines the method of working with registration of data changes after the end of data uploading (do not delete registration, completely delete registration, delete registration only for downloaded metadata).
    • Exchange protocol file name—specify the file name for logging the exchange procedure.
    • Download protocol (for COM connection) - the name of the log file when exchanging via a COM connection.
    • Append data to the exchange protocol—when this flag is set, the log file will be appended rather than overwritten.
    • Output of information messages to the log - not only information about errors, but also information messages will be added to the log file.
    • Open exchange protocol files after performing operations - the flag speaks for itself

    Deleting data