Where to get the exchange rules 1c 8.3 accounting. Automatic data exchange using Universal Data Exchange XML processing, without changing the configuration. Distributed information base

Each plan has a certain list of elements, information about the change of which it can store. This list is called "Exchange Plan Composition". The composition can be expanded, but the configuration support is removed.

The Plan Layout stores the very rules that sync works on. It is this conversion package (Registration Rules, Exchange Rules, Correspondent Exchange Rules) that we need for further study.

Let's consider an example of data synchronization between configurations "1C: Salary and personnel management 3" (ZUP) and "1C: Enterprise accounting 3" (BP). Note right away that in this task we will have to remove the configuration from support. This is required by condition.

A living example of the need to finalize the standard exchange rules

For example, a customer contacted us with the following problem: during synchronization between the ZUP and the BP, it is not possible to transfer the data of the "Registration with the tax authority" directory, which are necessary to fill out the document "Reflection of salary in accounting". Now the tabular part of this document on the side of the BP receiver contains an empty "Registration ..." and users have to manually create such entries in the reference book. Agree, this is inconvenient. We can refine this moment.

Solution to the problem: we will finalize the conversion package from the exchange plan ExchangeSalary3Accounting3. Let's add to the standard "1C Exchange Rules" a new "Object Conversion Rule" (PKO) for the "Registration with the Tax Authority" reference book and, accordingly, the "Property Conversion" of this reference book (PCS). We will definitely finalize the standard "Rules for registering objects", since it became necessary to register changes to the directory on the exchange node. And we will revise the "Rules of exchange 1C" of the correspondent base.

Where are we going to edit all this? to write and change the rules, we need the 1C: Data Conversion 2 configuration.

Modification of the standard conversion rules from the ZUP - BP Exchange Plan

So, we will start finalizing the 1C exchange rules by adding new item- Directory of Registration in the Tax Authority. We will make this change in both configurations "1C: Salary and Enterprise Management 3" and "1C: Enterprise Accounting 3".

Let's save and update the configurations.

In the enterprise mode, for each database, we will unload the description of the metadata structure using MD83Exp.epf processing for the 1C: Enterprise 8.3 platform. Processing can be found in the "1C: Data Conversion" set.

At the next stage, we will unload the conversion package from the ZUP and BP. The package should consist of 3 files: Registration Rules, Exchange Rules, Correspondent Exchange Rules.

Within the framework of this article, there will not be a description of how data synchronization is configured, it can be read on the website of the Coderline company in the section "Expert Articles" or you can watch the recordings of webinars. Now the databases have already configured this option. Therefore, go to the synchronization settings (Administration -> Data Synchronization -> Configure Data Synchronization), click the "Load rules" button. The form "Rules for synchronization" will open in front of us. By clicking the "More" button, select the "Save rules to file" item.


This is the package we should get after unloading.

We will perform similar actions for another information base "1C: Enterprise Accounting".
As a result, all the preparatory work for editing the rules is ready. We have:

Description of the metadata structure for loading into 1C: Data Conversion 2 (for ZUP and BP);

Conversion package, which contains 1C exchange rules and registration rules required for uploading to 1C: Data Conversion 2 (for ZUP and BP).

Go to "1C: Data Conversion 2". Let's perform the following steps in order for both infobases:

We load the metadata structures of our configurations;

We create conversions and load 1C data exchange rules from conversion packages (the rules file is called ExchangeRules);

Create registrations and load registration rules from conversion packages (the rules file is called RegistrationRules).


Let's go directly to our revision. In the 1C exchange rules, we add a new rule for object conversion (PKO) - the directory "Registration with the tax authority". Add a property conversion rule (PSC) for this directory and a data unloading rule (PST). This kind of revision must be performed both for the rules from the ZUP package and for the exchange rules from the BP package. We unload our exchange rules into the corresponding ExchangeRules files.

Let's move on to the rules for registering a new element. We add the directory "Registration with the tax authority". We unload the registration rules into the corresponding file from the RegistrationRules package. This action is also performed for both bases.

The revised exchange rules and registration rules are ready. Now, into the correspondent rules (CorrespondentExchangeRules) from the SPM package, copy the contents of the exchange rules (ExchangeRules) from the BP package. In the correspondent rules (CorrespondentExchangeRules) from the BP package, copy the contents of the exchange rules (ExchangeRules) from the SPM package.

As a result, you should get the following:

This completes the work in "1C: Data Conversion 2". The modified packages of conversion rules are ready, it remains to upload them back to the infobases and check the synchronization.

We archive the files from the packages into a ZIP archive and load our conversion packages into the ZUP and BP.

All is ready. It remains to test.

Let us recall the conditions of the problem. It was necessary to register for unloading the directory "Registration with the tax authority" and check how the PM of the document "Reflection of salary in accounting" is filled in on the side of "1C: Enterprise Accounting 3".

In the source "1C: Salary and Enterprise Management 3" we register our directory for unloading. We perform synchronization. We go to the receiver base and also perform synchronization to receive data. Please note that now the exchange plan has the necessary directory for registering changes.

We check on the side "1C: Enterprise Accounting 3":


Summarize. The result of the task was completed successfully. We have finalized the ZUP - BP exchange plan by adding a new element for registering changes and adding conversion rules for data synchronization.

Quite often in the work of large enterprises and retail chains there is a need for data exchange between databases. Each programmer and administrator resolves this issue differently. Someone writes upload-downloads through intermediate table files, someone uses the mode COM connections to connect to the source base. However, in recent years, its own 1C-ovsky mechanism called "Universal data exchange in XML format».

Processing appearance

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

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

  • Additional settings;
  • Data deletion.
  • 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 bookmark there is a field for selecting an exchange rules file. For non-standard bases and exchanges, you will have to create the exchange file yourself.

    There are two radio buttons on the next line of the form:

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

    As you can see from the above pictures, depending on the switch, the appearance forms. In case selected file variant exchange, the user is prompted to select the location of the file where the upload will be performed and the possibility of compressing it to save space and password protection.

    The option of direct connection to the receiver base supports both file and client-server modes of operation. In this case, it will be necessary to register the address of the base, fill in the fields "User" and "Password". Before proceeding with the exchange of data, it is advisable to test the connection.

    The tabular section below allows you to set up extractions and other unloading parameters.

    To debug algorithms and fix errors, you can use the mechanism built into the exchange processing. Its activation is performed by checking the corresponding checkbox at the bottom of the form. Pressing the button "Debug settings ..." calls the window (Fig. 4).

    Fig. 4

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

    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 section, but there are many more flags that allow you to adjust the parameters of 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 "Download file name" input field. If the data were uploaded to a password-protected archive, it will need to be entered in the appropriate field.

    The corresponding checkboxes allow you to configure:

    • A transaction when writing objects (this sometimes speeds up the process);
    • Uploading data in the exchange mode (in this case, all platform checks, with the exception of checking when posting documents, will be ignored when recording);
    • Overwriting changed elements;
    • Installing deletion marks for downloaded items;
    • The mode of writing new data to the register (either one by one or by dialing);
    • Trimming 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 fine-tune the exchange process. In particular:

    1. Turns on debug mode;
    2. Allows you to use a transaction in the upload process;
    3. Optimizes the exchange between databases of the 8th version of 1C;
    4. Unload 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 setting the appropriate checkboxes 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 exchange rules

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

    First of all, for the independent production of exchange rules, a special configuration is required, which is called "Data Conversion". It contains several interesting files that allow you to set up almost any exchange between different databases of 1C 7 and 8 versions:

    1. epf - required to unload the metadata structure for 1C 8 databases;
    2. epf - if the 1C 8 configuration is self-written or non-standard, it may not have Universal Data Exchange processing, this file is this processing;
    3. ert - the file contains the code for unloading the configuration metadata structure of 1C versions 7.7;
    4. ert - file for processing data unloading and loading for the seven.

    Having started the appropriate processing, it is necessary to unload the metadata structures for the source base and the receiver base. Then, in the “Conversion” configuration, it is necessary to enter information about the source and receiver configurations in the “Configurations” directory.

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

    2018-11-15T19: 32: 35 + 00: 00

    Universal processing "Upload and download XML data" performs full or partial upload of infobase data into a file in XML format. Subsequently, this file can be loaded into the infobase using the same processing. The format of the upload file differs from the format of the file created when uploading according to the exchange plan by the header part.

    Processing can only be used in cases where information base, in which the data was unloaded, and the one in which the data is loaded, are homogeneous (configurations are identical, data may differ), or all unloaded objects are almost completely identical in composition and types of attributes and tabular sections, properties of the "lead" metadata object, and so on.

    The use of this processing is possible, for example, for creating a full or partial backup of data, for exchanging data between infobases, and also as an auxiliary tool in restoring failed infobases.

    Processing supports uploading data with the ability to specify a selection by period. Also, objects are checked for invalid characters when exchanged via XML.

    Best regards, (teacher and developer).

    Universal data exchange mechanism is intended both for creating geographically distributed systems based on 1C: Enterprise 8, and for organizing data exchange with other information systems not based on 1C: Enterprise 8.

    This mechanism allows you to transfer only 1C: Enterprise data; transfer of configuration and administrative information of 1C: Enterprise 8 using this mechanism is impossible.

    Possibilities

    • data exchange can be implemented with both 1C: Enterprise information bases and with other information systems;
    • organizing various messaging strategies;
    • realization different ways resolving collisions while changing data in different nodes of the distributed system;
    • implementation of restoring data exchange in such cases as restoring infobases from backups etc.

    Peculiarities

    • XML documents are used as the exchange format;
    • when exchanging data between infobases 1C: Enterprise 8, no restrictions are imposed on the identity of the configuration and structure of specific objects;
    • in one configuration, several independent exchange schemes with various information systems can be created;
    • when organizing the exchange scheme, no restrictions are imposed on the structure of the distributed system. Can be organized as a classical structure of the "star" type, and more complex multi-level structures such as "snowflake" and others;
    • the developer of the application solution is given the opportunity to flexibly control the composition of the exchange, both from the point of view of the structure of the transmitted data, and from the point of view of the composition of the information transmitted to specific exchange nodes;
    • the database object is initially created in one of the exchange nodes. The content of the transmitted information can be regulated depending on the content of the data, and does not depend on the place where the information was originally entered.

    Components

    A universal data exchange mechanism is not a hard decision. Its work is implemented by a set of tools of the 1C: Enterprise 8 technological platform, which can be used in applied solutions in various combinations.

    • Exchange plan
      Configuration Objects An exchange plan is the center around which other communication media are grouped. With the help of these objects, a set of nodes of a distributed system and the composition of data that are supposed to be exchanged within the framework of a given exchange plan are described.
      In addition, exchange plans implement the work of two important mechanisms involved in the exchange of data:
      • Change registration service
        It allows you to receive information about which data elements have been changed, and to which exchange node they need to be transferred.

    If you exchange data between the Trade Management 10.3 and Enterprise Accounting 2.0 configurations, then after updating one of the configurations, you need to update the exchange rules.

    Consider the case when the exchange was configured from the Trade Management configuration and configured through a direct connection to the receiver base, i.e. accounting department. You need to load new rules through the data exchange setting in the Trade Administration. It is highly recommended to make bases before doing this.

    Launching 1C Trade Management 10.3. Select the item "All data exchange settings" from the menu Service => Other data exchanges.

    We select the section "All exchanges". We find your data exchange in the list, click right click mouse and click "Change". If you try to change the exchange settings from the section “Data exchange with 1C: Accounting 8”, then when you try to change the data exchange settings assistant will be launched, which we do not need.

    In the window that appears, we see that the exchange is taking place according to the exchange rules, which can be saved and loaded. The rules for uploading to the exchange base are the rules by which information is downloaded from the Trade Department to the Accounting Department, and the rules for uploading from the exchange base to the current base are the rules according to which information is loaded from the Accounting Department to the Trade Department.

    Let's load the rules for uploading to the exchange database. Click “Load rules from file”. Attention, if you have an atypical configuration and you use atypical exchange rules, i.e. developed specifically for your modified configuration, then you should contact the experts to create new rules based on the existing ones.

    Do not under any circumstances replace them with standard rules. If you are not sure that you have typical configurations, just in case, save the existing rules by clicking the “Save rules to file” button.

    Since the latter came out much later than the update for Trade Management, we are looking for exchange rules in the catalog of 1C update templates for Accounting. You can find the update templates directory as follows. Launch 1C and click "Settings". In the window that appears, we see the path to the directory of configuration templates and updates.

    We pass along this path. Next: 1C => Accounting and select the folder with the name of the last installed Accounting release. If the rules need to be taken from the 1C: Trade Management configuration update, the folder will be called Trade. For the 1C: Retail configuration - Retail. It contains the "Data Exchange" folder.

    Further “Exchange with configuration Trade management, rev. 10.3 ". In it we see the RULES OF CONVERSION OF BP-UT and RULES OF CONVERSION OF UT-BP. Since we need rules for unloading from UT, select “UT-BP CONVERSION RULES” and click open. We do the same for the rules for unloading from the exchange base to the current base, only select the file RULES FOR CONVERSION BP-UT and click open.

    In the folder “Exchange with configuration Trade management, ed. 10.3 ”is the file Sharing.htm. If you have never read it, be sure to read it. It contains the following useful information:

    • Sharing goals
    • general description
    • Migrating from Legacy Bidirectional Data Exchange
    • Preliminary actions
    • Procedure for setting up data exchange between configurations
    • Data sync
    • Joint work of the "Trade Management" and "Enterprise Accounting" configurations
    • Sample user scenarios
    • Correspondence table of uploaded documents UT - BP (revision 1.6, revision 2.0) Correspondence table of uploaded documents BP (revision 1.6, revision 2.0) - UT
    • Features of unloading documents and directories
    • Correspondence table of uploaded documents BP (revision 1.6, revision 2.0) - UT
    • Transfer of documents "Invoice for payment to the buyer" and "Order of the buyer"
    • Transferring the cost of writing off goods
    • Monitoring the results of data exchange

    We check the rules with the check buttons. And click OK. The new rules have been saved. We start the data exchange and check their work.

    How to set up two-way data exchange between the Trade Management 10.3 and Enterprise Accounting 2.0 configurations is described in my other article.