Data exchange 1s 8 1. Appearance and features of using universal data exchange. Setting up important points in data exchange between UT and BP

In the 1C configuration "Trade Management, edition 11" there are several built-in exchange plans, including those with the configuration "Enterprise accounting, edition 3.0" (Fig. 1).

Represents a set of rules by which objects from one configuration will be loaded into another. In our instructions, we will set up the exchange between 1C Accounting 3.0 and 1C Trade Management 11 based on the 1C 8.3 platform.

The presence of the plan we need in the list of typical exchanges greatly facilitates the integration process. However, there are a few preliminary settings that need to be made, in both configurations.

First, consider the sequence of actions in 1C Enterprise Accounting 3.0. Let's find in the section "Administration - Settings" the item "Setting up data synchronization" (Fig. 2).

Here you need to enable the "Data synchronization" checkbox and be sure to specify the prefix of our database (Fig. 3). If you wish, you can - no data will be loaded or changed before this date.

Now we go to the "Data synchronization" tab and configure the exchange itself (Fig. 4). There may be several exchanges. A separate line is created for each (button with a plus sign "Set up data synchronization"). In the demo database of 1C Accounting, we already have two entries. Let's check the settings of the latter (button with a pencil "Set up rules ...").

We only fill in the “Rules for receiving data” tab (Fig. 5), since we will not send anything. On the "Data sending rules" tab, check the "Do not send" checkboxes.

It remains to check the connection parameters (Fig. 6). We select "direct connection", specify the address of the database on the disk from which we will receive data, and the user / password of the same database. The user must have full rights or at least rights to perform synchronization. Sometimes a virtual user is created specifically for exchanges.

Detailed information about the settings of this section can be obtained from the help (F1).

Similar settings are performed in the "1C Trade Management 11" database.

Setting up an exchange from the Trade Management 11

In different releases, the section we need may have a different name. In our example, this is the item "Integration settings - Other programs" (Fig. 7).

The rest is similar. The same "Data Sync" checkbox, the same item and similar settings. (Fig.8).

Only the prefix is ​​different. It is important!

Get 267 1C video lessons for free:

Go to the "Data Synchronization" tab and create a new exchange. You can select the configuration with which we want to exchange by clicking the "Configure data synchronization" button, the exchange itself is created by clicking the "Configure" button (Fig. 9).

From this moment, the differences from the previous setting in BUX.3.0 begin. We need to fill in the "Data sending rules" tab (Fig. 10). And the main thing to do is to determine the composition of the data being sent.

There are several ways to select the data that we are going to transfer (Fig. 11). All of them are collected in the "Register" section. You can select either a single object or a list. Or all at once.

Let's return to the previous tab and perform another important point, already familiar to us - specify the connection parameters (Fig. 12). Parameters are configured in the same way as for accounting. Only this time we are using a virtual user named "Exchange".

Launching and checking the exchange between 1C Accounting 3.0 and 1C Trade Management 11

The exchange is performed by the "Synchronize" button, which is located on the first page of the settings (Fig. 13). This button can be found on other pages as well. Moreover, there is not much difference in which of the two configurations this button is pressed. The exchange is two-way.

Click the button and go to the next step.

If the exchange is performed for the first time, then you will have to perform manual synchronization, that is, compare the same objects of two configurations, if any (Fig. 14). If this is not done, duplicates may appear.

At the next step, it will be possible to select organizations for which data will be transmitted, and some other selections (Fig. 15).

A description of all selections appears in a special window, and a complete list of objects that will be sent can be obtained in the report on the composition of the data being sent (Fig. 16).

The exchange can take a long time, the time depends on the number of transferred objects. After the process is completed, we get a picture of the following form - Fig. 17. By clicking the "Settings" button, you can set the schedule according to which the exchange will be performed automatically.

Exchange plans in 1C 8.3 is a configuration metadata object used to implement data synchronization in the 1C 8 system.

An exchange plan can be compared to a directory, where elements are infobase nodes. However, there are many nuances in working with exchange plans, we will talk about them below.

Usually, the exchange in 1C is built using special exchange rules, which are formed using the configuration.

As previously noted, the exchange plan is very similar to the usual one, and therefore we will consider only the main differences in the exchange.

How to work with the exchange plan

The exchange plan can store information and changes to the elements from the exchange plan, and also stores information about the number of the current message. In general, the scheme of work is as follows:

  1. We change the data (directories, documents, etc.) in the database - the exchange plan remembers the changes. Either by auto-registration, or by program code (for example, the Exchange Plans.RegisterChanges method).
  2. When the time comes, we get a list of changed elements - the ReadChanges() method, unload this data.
  3. When uploading / downloading, to avoid collisions, we check the message numbers of the exchange plan. If they do not match, we cancel the data exchange; if they do, we remove the registration of changes and increase the message number.

Get 267 1C video lessons for free:

Distributed infobase

If this flag is set in the settings, then this exchange plan is a distributed infobase (DIB).

- a geographically distributed system based on the same configuration 1C 8.3. RIB, in addition to data changes, can also transfer configuration changes, which is very convenient, for example, when updating a configuration release.

Composition of the exchange plan

The setting with which the developer manages the set of objects to be exchanged:

As part of the exchange plan, there can be 3 states of the object:

  1. Not included in the exchange plan- accordingly, in no way can you configure data exchange for this exchange plan for such an object.
  2. Auto-registration Deny- this means that it is necessary to register changes for this node only by program code according to some condition, as a rule, . The ExchangePlans.RegisterChanges() method is used.
  3. Auto-registration Allow- if this checkbox is set, then any changes to the element will automatically be included in the list of exchange plan changes.

Exchange plans and performance 1C

Due to the system features of the implementation of exchange plans, it is not recommended to abuse the uploading of changes according to exchange plans. The matter is that at reading of changes all tables of changes are blocked. Those. when unloading, the exchange plan does not allow writing new changes, and therefore blocks the elements themselves - directories, documents, etc.

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. Someone writes uploads and downloads through intermediate table files, someone uses the COM connection mode to connect to the source database. However, recently, its own 1C mechanism called "Universal Data Exchange in XML Format" is gaining more and more popularity.

Processing Appearance

In the Full interface, you can open the processing at Tools->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.

    Data upload

    At the very top of the tab there is a field for selecting the exchange rules file. For non-standard databases 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 IB (Fig. 3).

    As you can see from the figures above, depending on the radio button, the appearance of the form is different. If the file exchange option is selected, 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 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, it will be necessary to register the address of the base, fill in the fields "User" and "Password". Before you start exchanging data, it is advisable to test the connection.

    The tabular part below allows you to configure the selections and other upload parameters.

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

    Fig.4

    A distinctive feature of this form is informative help on the left side of the layout, which describes each of the three possible debugging modes. Any file of the epf format can act as an external processing file with the module.

    Clicking on the "Finish" button checks the correctness and completeness of the filled data.

    Unlike "Unload", this tab (Fig. 5) does not have a tabular section, 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 the exchange mode (in this case, all platform checks, with the exception of checking when posting documents, will be ignored during recording);
    • Overwriting changed elements;
    • Setting a deletion flag for downloaded items;
    • The mode of writing new data to the register (either one by one or in a set);
    • Trimming non-significant characters (spaces and tabs) for string values.

    Additional settings

    As is clear from the name of the tab, it contains tools, the use of which allows you to fine-tune the exchange process. In particular:

    1. Enables debug mode;
    2. Allows you to use the 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 delete unnecessary objects from the database.

    Briefly about setting up exchange rules

    Using a standard handler makes life much 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 exchange rules file?".

    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 configure almost any exchange between various 1C 7 and 8 databases:

    1. epf - needed 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 the “Universal Data Exchange” processing, this file is this processing;
    3. ert - file contains code for unloading the metadata structure of 1C versions 7.7 configurations;
    4. ert - processing file for uploading and downloading data for the seven.

    Having launched the appropriate processing, it is necessary to unload the metadata structures for the source database and the destination database. Then, in the "Conversion" configuration, you must enter information about the configurations of the source and receiver into the "Configurations" directory.

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

    Task

    Transfer information about counterparties from UP in BP. Data is transmitted unilaterally, identification is made by a unique identifier. Conversion rules are configured using a special configuration Data conversion, edition 3.0(Further - CD 3.0).

    Actions to take

    Stage 1. Preparation for setting up rules.

    To set conversion rules in configuration CD 3.0 must contain information about the structure of infobases between which data is synchronized, as well as about the structure of the format Enterprise Data.

    Step 1. Unloading the structure of information bases of UE and BP.

    To unload information about the structure of the infobase, processing is used. MD83Exp.epf, supplied with the configuration CD 3.0.

    For each infobase ( UP and BP) you need to do the following:

    1. Open the infobase in the "Enterprise" mode.
    2. Open External Processing MD83Exp.epf(Menu File & Open).
    3. Specify the name of the file where the infobase structure should be saved.
    4. Check the settings in the processing form (all flags must be cleared).
    5. Push button Unload.

    Step 2. Export the xml schema of the exchange format

    To unload the exchange format scheme, the standard features of the platform are used.

    You need to do the following:

    1. Open one of the infobases (or UP or BP) in the “Configurator” mode.
    2. Find XDTO packages with names in the metadata tree ExchangeMessage and EnterpriseData_1_0_beta.
    3. Place the cursor on the XDTO package, press the right mouse button and select the item in the context menu Export XML Schema. Specify the path and file name for the export. Perform this step for each of the two packages, saving the XML schemas to two different files.

    Step 3. Loading the infobase structure into the CA 3.0 configuration

    Loading in config CD 3.0 in Enterprise mode. The following steps must be performed for each of the configurations for which conversion rules are configured ( UP and BP).

    1. Go to section Configurations, and choose a command
    2. Specify the path to the file with the infobase structure (see Stage 1, Step 1).
    3. Specify download method & to the new version of the configuration.
    4. Push button Download

    Step 4. Loading the structure of the exchange format into the configuration of CD 3.0

    1. Go to section Data format, and select a command.
    2. Specify files with format structure (see Stage 1, Step 2). You must specify both files at once using multiple selection.
    3. Check main XDTO package name - must match XDTO package namespace EnterpriseData_1_0_beta(see in the configurator UP or BP).
    4. Specify download method & to the new format.
    5. Push button Download, wait for the download to finish.

    Stage 2. Creating conversions

    To solve the described problem, you need to create two conversions:

    • UE (for unloading data from UP to exchange format)
    • BP (for loading data from the exchange format to BP)

    Conversions are created in the section Conversions, team Conversions. For a new conversion, you must specify the name, configuration and exchange format. For example, conversion for UE configuration:

    • Name& “UP2.0.7”.
    • Configuration& “Enterprise Management”.
    • Supported Format Versions& one line in which the only position of the directory is selected Format versions.
    • data processing rules,
    • object conversion rules,
    • rules for converting predefined data.

    To go to a set of rules for a specific conversion, go to the section Conversions, choose a team Setting up conversion rules and select a specific conversion from the list for which the rules will be configured. This will open the form. Setting up exchange rules, which contains all the rules for a specific conversion.

    Stage 3. Creating object conversion rules

    Step 1. Conversion rule for unloading counterparties from the UE

    1. UP.
    2. Go to bookmark
    3. Basic information:
      1. Rule ID: “Directory_Contractors_Sending”,
      2. Configuration object
      3. Format object: “Reference book. Contractors”,
      4. Application area: To send.
    4. Push button burn and go to bookmark Property conversion rules:
      1. Use the automatic property mapping service
        1. Push button PCC setup
        2. In the form that opens, click Automatch. The properties “TIN”, “KPP”, “Name”, “NameFull”, “Additional Information”, “Legal Individual” will be compared
        3. and close the form for setting property conversion rules
    5. Push button Write and close.

    Step 2. Conversion rule for uploading counterparties to BP

    1. Open the exchange rules setting for conversion BP.
    2. Go to bookmark Object conversion rules.
    3. Create a new conversion rule and fill in the data on the tab Basic information:
      1. Rule ID: “Directory_Contractors_Receive”,
      2. Configuration object: “DirectoryLink.Contractors”,
      3. Format object: “Reference book. Contractors”,
      4. Application area: To receive.
    4. Push button burn and go to bookmark Identification. Specify the identification method "By unique identifier".
    5. Go to bookmark Property Conversion Rules
      1. Use the automatic property mapping service:
        1. Push button PCC setup
        2. In the form that opens, click Automatch. The properties “TIN”, “KPP”, “Name”, “Full Name”, “Additional Information”, “Legal Individual” will be compared.
        3. Save auto match result & click button Create Property Conversion Rules and close the form for setting property conversion rules.
      2. Manually add a property conversion rule for OKPO (configuration property & “CodePoOKPO”, format property & “OKPO”).
      3. You will later need to return to the property conversion rules to complete the property conversion rule for the "LegalPerson" property, which is an enumeration.
    6. Go to bookmark Before Writing Received Data and write an algorithm to fill in the country of registration of a new counterparty. The algorithm contains the following text: "ReceivedData.Country of Registration = Directories.Countries of the World.Russia;".
    7. Push button Write and close.

    Stage 4. Creating rules for converting predefined data

    1. UP or BP)
    2. Go to bookmark Predefined data conversion rules
    3. Create a new conversion rule and fill in its properties:
      1. Rule ID: “Transfer_LegalPhysicalEntity”
      2. Configuration object: “EnumerationReference.LegalIndividual”
      3. Format object: “Legal Individual”
      4. Application area: for sending and receiving
      5. In the table field, fill in the correspondence between the values ​​of the enumeration of the configuration and the format: “Individual” & “Individual” and “LegalEntity” & “LegalEntity”
      6. Push button Write and close
    4. Specify a new rule in the rule for converting the “LegalPhysicalEntity” property of the lookup Counterparties
      1. Go to bookmark Object Conversion Rules
      2. Counterparties, open the rule form
      3. Go to bookmark Property Conversion Rules and find the rule for the “LegalPhysicalEntity” property
      4. Open the property conversion rule form and specify the object conversion rule in it & “Enumeration_LegalPhysicalEntity”.
      5. Save your changes

    Stage 5. Creating data processing rules

    The procedure is the same for both conversions.

    1. Open the exchange rules setting for conversion ( UP or BP)
    2. Go to bookmark Object Conversion Rules
    3. Find a dictionary conversion rule Counterparties, open the rule form
    4. Push button Create Based & Data Processing Rule
    5. In the created data processing rule, check the automatically filled properties:
      1. Rule ID& specify the same as for the data processing rule (“Reference_Accounts_Sending” or “Reference_Accounts_Receive”)
      2. Application area& same as for data processing rule
      3. Sample object:
        1. for conversion UP& “DirectoryLink.Contractors”
        2. for conversion BP& “Reference.Contractors”
      4. Object conversion rule& reference to the object conversion rule.
    6. Push button Record and close.

    Step 6. Obtaining the communication manager modules

    The communication manager module is required to exchange data between configurations as configured in CD 3.0 rules.

    The procedure is the same for both conversions:

    1. Open infobase UP or BP in config mode. Find a common module in the metadata tree Exchange ManagerViaUniversalFormat and open it for editing. The module must be empty.
    2. Open infobase CD 3.0 in Enterprise mode.
    3. Go to section Conversions and choose a team Module unloading.
    4. In the form that opens, specify the appropriate conversion and click the button unload. The module will be copied to the clipboard.
    5. Go to infobase configurator UP or BP and paste the contents of the clipboard into the shared module Exchange ManagerVia UniversalFormat.
    6. Save configuration.

    Unloading a module to the clipboard can also be done from the form for setting exchange rules by clicking the button Save exchange manager module.

    In order for data to be exchanged according to the configured rules, it is necessary to set up data synchronization in both infobases in the “Enterprise” mode using the universal format.

    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 1C: Enterprise 8 using this mechanism is not possible.

    Opportunities

    • data exchange can be implemented both with 1C:Enterprise information bases and with other information systems;
    • organization of various messaging strategies;
    • implementation of various ways to resolve collisions while changing data in different nodes of a distributed system;
    • implementation of data exchange recovery in such cases as restoring infobases from a backup, etc.

    Peculiarities

    • XML documents are used as an exchange format;
    • when exchanging data between 1C:Enterprise 8 infobases, 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 an exchange scheme, no restrictions are imposed on the structure of a distributed system. It can be organized as a classic star-type structure, as well as more complex multi-level snowflake-type structures and others;
    • the developer of the applied solution is given the opportunity to flexibly control the composition of the exchange, both in terms of the structure of the transmitted data, and in terms of the composition of the information transmitted to specific exchange nodes;
    • the database object is initially created in one of the exchange nodes. The composition of the transmitted information can be adjusted depending on the content of the data, and does not depend on the place of the initial input of information.

    Components

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

    • Exchange plan
      Configuration objects The exchange plan is the center around which other means of communication 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 this exchange plan are described.
      In addition, exchange plans implement two important mechanisms involved in data exchange:
      • Change Registration Service
        Allows you to get information about which data elements have been changed and to which exchange node they need to be transferred.