Data conversion 3.0. Well-known links to KD3 documentation

Data conversion 3.0. Well-known links to KD3 documentation

Data conversion 2.0 and 2.1 is a technological configuration of 1C, implemented on platform versions from 8.1 to 8.3.

The main task of the tool is to write rules for exchange between application solutions 1C 8 and 7. The current version of data conversion today is 3.0.

Data conversion is a very useful configuration; with its help you can solve not only the issue of transferring information from one information base to another, but also, for example, converting information within one database.

The configuration is very convenient to use with .

Data conversion will be useful to any programmer: having the skills to create exchange rules is a serious plus for professional skills.

To learn how to work with a configuration, solving practical problems is best suited. Try to come up with tasks for yourself, for example: transfer some information from one database to another, turn a sales document into a receipt document, “enter” current accounting balances into a document “entering balances” and other tasks.

It will be very useful to understand the “standard” exchange rules of 1C 8.3; there you can often find interesting examples of implementing tasks.

To understand the basics, you will need materials, we will consider them below.

Video instructions for conversion

For the basics of setting up data exchange in 1C using the “1C Data Conversion” configuration, see the example in the video:

Materials, textbooks for studying 1C Data Conversion 2.0

There are not too many materials and documentation on the Internet, I tried to collect the most important and interesting materials:

0. First of all, I recommend the free video course by Ilya Leontyev, it is available at link.

1. I would advise first of all to use the built-in help in the configuration. It is really well written and technically well implemented:

2. The second most important source of information is the site http://www.mykod.info/ (the site has closed), specialized specifically in data conversion. There you can download a large number of materials on conversion.

3. Separately, I would like to highlight the textbook - (author - Olga Kuznetsova).

  • Video – 21 teaching hours
  • Teaching materials in PDF - 117 A4 pages
  • 16 practical tasks with teacher solutions

Course format, support

The materials are available immediately after payment for the order - you download them from the site and study them at any convenient time.

Support is provided through the Master Group on the website.

Full access to the Master group must be activated no later than 100 days after purchase.

Relevance of the course

The course materials are relevant for BSP version 2.3.2.73.

If you plan to use older versions of the BSP, then please note that the operating mechanisms of the BSP “Data Exchange” subsystem have changed, and the interfaces have also changed.

A new course for the latest versions of the BSP is under development and will be released in a few months. But for versions of BSP 2.3.2.73 and younger, the current rate will be relevant.

Course fee

9,700 rubles

Guarantee

We have been teaching since 2008, we are confident in the quality of our courses and give our standard 60-day warranty.

This means that if you started taking our course, but suddenly change your mind (or, say, do not have the opportunity), then you have a 60-day period to make a decision - and if you make a return, we return 100% of the payment.

Installment payment

Our courses can be paid for in installments or in installments, including without interest. Wherein You get immediate access to materials.

This is possible with payments from individuals in the amount of RUB 3,000 or more. up to 150,000 rub.

All you need to do is select the payment method “Payment via Yandex.Checkout”. Next, on the payment system website, select “Pay in installments”, indicate the term and amount of payments, fill out a short form - and in a couple of minutes you will receive a decision.

Payment options

We accept all major forms of payment.

From individuals– payments from cards, payments with electronic money (WebMoney, YandexMoney), payments through Internet banking, payments through communication shops, and so on. It is also possible to pay for the order in installments (in installments), including without additional interest.

Start placing your order - and in the second step you can choose your preferred payment method.

From organizations and individual entrepreneurs– cashless payment, delivery documents are provided. You enter an order and you can immediately print an invoice for payment.

Training of several employees

Our courses are designed for individual learning. Group training on one set is illegal distribution.

If a company needs to train multiple employees, we typically offer “add-on kits” that cost 40% less.

To place an order for an “additional kit” select 2 or more course sets in the form, starting from the second set the cost of the course will be 40% cheaper.

There are three conditions for using additional kits:

  • You cannot purchase only an additional set if at least one regular set was not purchased before (or along with it)
  • There are no other discounts for additional sets (they are already discounted, it would be a “discount on a discount”)
  • promotions are not valid for additional sets (for example, compensation of 7,000 rubles) for the same reason

Print (Ctrl+P)

Data conversion, edition 3.0

Lesson 1. Preparing to work with KD3.0

Data conversion, edition 3.0(Further KD3.0) – is one of the components of data exchange technology through the format EnterpriseData. KD3.0 is not a replacement for configuration Data conversion, edition 2.0(Further KD2.0). This is a new standard that is very different from KD 2.0. Main purpose KD3.0 – this is the creation of a program code for an exchange manager module, consisting of procedures and functions that implement the logic for loading data presented in the format EnterpriseData, as well as the logic for uploading data into the format.

Fig 1 General exchange manager module

KD3.0 can be downloaded from https://users.v8.1c.ru/

Revision 3.0.5.3, intended for use with the system version
1C:Enterprise 8.3 is not lower than 8.3.10, and edition 3.0.4.3 is for use with the 1C:Enterprise 8.3 system version is not lower than 8.3.8.

Delivery KD3.0 contains the following external processing

  • Treatment MD83Exp.epf“Uploading a description of the metadata structure of configuration 8.3” – is intended for uploading a description of the metadata structure of any configuration implemented on the 1C:Enterprise 8.3 platform.
  • Treatment Uploading synchronization rules.epf“Uploading synchronization rules through a universal format” used when preparing conversion rule files intended for subsequent loading into the “Data Conversion” configuration, edition 3.0.
  • The file “Configuration Description.htm” contains a brief description
    basic configuration functionality
    “Data Conversion”, edition 3.0.

Additional information on the “Data Conversion” configuration, version 3.0
see http://its.1c.ru/db/metod8dev#content:5846:hdoc

1. Preparing to set up rules

To load the format structure, you must first open the configuration database in configurator mode and download XDTO packages from the configuration into *.xsd files.

It is necessary to unload all packages that are associated with the format. The names of the files are not of fundamental importance. You must also upload the ExchangeMessage XDTO package

After loading the XDTO format into CD 3.0, the directories “Format Objects”, “Format Properties”, “Format Values” are filled in

IN reference book “Format objects” loading:

  • Objects with the type “ObjectTypeXDTO”, which reflect reference data types (documents, directories)
  • Objects of type “XDTOValueType” containing an enumeration. They reflect predefined data (e.g. enumerations)

IN reference book “Format properties” loading:

  • Properties of “ObjectTypeXDTO” objects. At the same time, the objects themselves are those that were loaded into “Format Objects”
  • Objects with the type “ObjectTypeXDTO” and their properties that reflect tabular parts and details of tabular parts

The properties of the “XDTOValueType” objects, which are elements of predefined data, are loaded into the “Format Values” reference book. At the same time, the objects themselves are those that were loaded into “Format Objects”

1. 2. Processing “Loading configuration structure”

This processing loads the configuration metadata structure into the infobase Data conversion ed.3.

To download information about the structure of the infobase, processing is used MD83Exp.epf, included in the delivery kit for the KD3.0 configuration

For the infobase whose structure needs to be unloaded, perform the following steps:

  1. Open the infobase in Enterprise mode.
  2. Open external processing MD83Exp.epf(Menu File - Open).
  3. Specify the name of the file in which to save the infobase structure.
  4. Check the settings in the processing form (all flags must be cleared).
  5. Press the button Unload.

After downloading the configuration structure, the directories are filled in

  • Metadata objects
  • Object Properties
  • Object values.

Directory Metadata objects contains information about configuration metadata objects. The type of objects is recorded in the corresponding attribute. Depending on the value of the Type attribute, the details describing the properties of the metadata object are filled in. Details of metadata objects are described in the subordinate directory Object Properties. Object values ​​(enumeration values ​​and names of predefined elements) are described in a subordinate directory Object values.

Before loading synchronization rules through a universal format, the data format must be loaded from files (using processing(see clause 1.1), and the configuration for which the synchronization rules are configured must also be loaded. The configuration is loaded using processing ( see point 1.2) . Note also that directory item to be created Conversions . To convert, you must specify the configuration and one or more format versions for which the conversion is intended.

1.3.1 Preparing files for loading rules

Files are prepared in the infobase for which the exchange will be carried out in a universal format (for example, Enterprise accounting ed.3.0).

To prepare rule files, you must enter the infobase in Enterprise mode and start processing Uploading synchronization rules via a universal format, which is included in the configuration delivery Data conversion ed.3.

To prepare a file with a manager module, you must enter the information base in Configurator mode and save the general module Exchange Manager Through Universal Format to a text file. You can specify any file name.

All prepared files must be located in the same directory.

1.3.2 Loading synchronization rules

Performed in the infobase Data conversion ed.3 by processing Loading synchronization rules from files.

In the processing form, indicate:

  • Exchange directory in which previously prepared files are located
  • Conversion
  • Composition of downloaded data
    • or specify the “all” option
    • or select selective loading and configure the list of rules that should be loaded
  • File with the exchange manager module (not required if selective loading is performed and handlers are not loaded)
1.3.3 Features of loading into a non-empty database
  • If the loaded rule exists and it belongs to only one conversion (the current one), the rule will be changed. In this case, the analysis of differences between the existing and loaded rules is not performed; the rule is refilled and written unconditionally.
  • If the loaded rule exists and it belongs to several elements of the Conversions directory, including the current conversion, a new rule will be created and linked to the current conversion. The “old” rule will remain unchanged and will remain tied to other conversions.
  • Rule groups are not loaded. But if the rule was assigned to a certain group, when it is re-loaded into this rule, this information will be saved.

In this article I will describe my, so far small, experience in organizing data exchange through the universal EnterpriseData format.

In my case, the exchange is configured between the “Trade Management 11.2” (hereinafter UT) and “Enterprise Accounting 3.0.43” (hereinafter BP) configurations. The exchange is one-way, from UT to BP. Before upgrading Trade Management 11.1 to 11.2, data exchange was configured using the Data Conversion 2.0 configuration. However, after switching to “11.2”, errors appeared in “Trade Management” for users. The procedure for updating the exchange rules was carried out, but it did not produce any results. The debugger showed that the problem was in data exchange. It was decided to remove the data exchange setting in both configurations and configure it again.

Both “Trade Management” and “Enterprise Accounting” work in a client-server version. I started setting up synchronization with UT. I performed it in such a way that the data was uploaded from the UT to a file. That is, synchronization through a network directory. In the BP I configured the exchange in such a way that no data is downloaded from the BP.

Error when calling context method (Verify): XDTO data validation error:
The structure of the object "/Counterparty Bank Account/Bank" does not correspond to the type: (http://v8.1c.ru/edi/edi_stnd/EnterpriseData/1.1)KeyPropertiesBank
Checking the "BIK" property:
shape: Element
name: (http://v8.1c.ru/edi/edi_stnd/EnterpriseData/1.1)BIK
type:
Required property missing
Object: Contract with Counterparty No. ...

To analyze the error, I clicked on the “Composition of sent data” icon and in the list of contractor agreements registered for sending, I found the agreement for which the error appeared. I opened the agreement and remembered the counterparty’s bank account specified in the agreement. Then I moved on to the bank accounts registered for shipping. It turned out that the required account was not in the list of registered ones. I redid the problematic bank account and contract. After that, I manually registered the required bank account.

I tried again to synchronize data from UT. This time the data was successfully uploaded. An XML file was generated in the network folder containing data to be transferred from the UT to the BP.

The next step is to load the data from the file into the enterprise accounting department. In the "Enterprise Accounting" configuration, I clicked the "Synchronize" button, a processing form opened with the message "Data analysis in progress." A little later the message changed to “Data upload in progress.” At the same time, the indicator and counter showed that more than 80 thousand objects were being unloaded from the power supply unit. This confused me, because I indicated in the settings that nothing should be unloaded from the power supply. The processing took quite a long time and ended with the error:

Event: Data Exchange
(GeneralModule.Long-runningOperations.Module(371)): Background job worker process terminated abnormally
RaiseException(ErrorText);

To localize the error, I tried changing the synchronization settings and operation options of the power supply base. As a result, when I converted the database to a file version, the system worked adequately: a form for comparing two databases opened. After matching the objects, the initial synchronization was successful. Then I switched the database back to the client-server version.

With further testing of synchronization, it was necessary to make some changes to the rules for converting objects. It's time to use the Data Conversion 3.0 configuration. The built-in configuration help describes the operating procedure. Articles on the ITS website also helped.

As a result, I loaded the following data into "Data Conversion 3.0":

  • Texts of the general module "Data Exchange Manager Through a Universal Format" from two databases
  • Layout of both bases
  • Description of the EnterpriseData format (from any one database)
  • Conversion rules

After downloading, I opened the rules for converting data, objects, and properties in “Data Conversion 3.0.” Made the changes I needed. Then I used the "Unload exchange manager module" button. The module text has been copied to the clipboard. All that remains is to insert it into the configuration.

Having experimented with setting up the rules in "Data Conversion 3.0", I concluded for myself that in the case when the changes being made are insignificant, it is easier to set up the rules directly in the UT and BP configurations, in the general module "Data Exchange Manager Through the Universal Format". If the edits are serious, such as, for example, adding a new object to the exchange, then you should use the configuration " Data conversion 3.0".

I performed the task of adding the document "Order to supplier" to the exchange plan using " Data conversion 3.0". In the standard version of UT - BP this document is not included in the exchange plan.

Let's remember that the rules for registering objects for uploading are still configured in the "Data Conversion 2.0" configuration.

These are the first impressions of data synchronization through the universal EnterpriseData format.

P.S. If you have questions or your own observations about data exchange via the Universal Format and Configurations" Data conversion 3.0", write in the comments. We will exchange experiences.

  • Data synchronization
  • Universal EntepriseData Format
  • Data conversion 3.0
  • Data conversion 2.0
  • Trade management
  • Enterprise accounting

The purpose of this article is to answer the first questions about CD3 and use a simple example to show how to refine the standard rules. The information is useful for beginners and those who have already started learning and have new questions.

Accepted abbreviations in this publication

KD2- configuration Data conversion, edition 2.0.
KD3- configuration Data conversion, edition 3.0, configuration 3.0.5.3.
ED- universal EnterpriseData exchange format.

Answers to questions after a superficial acquaintance with KD3. If you know why KD3 is needed, you don’t have to read this paragraph;)

Questions and answers

  • Is KD3 a new version of KD2? No! This is another tool that solves similar problems to KD2. Each tool has its own use.
  • Is KD3 better than KD2? They cannot be compared, because... These are different tools and each has its own pros and cons.
  • To change the KD3 exchange rules you need remove the configuration from support? No No need to remove from support! In standard configurations, you can normally connect external processing with rules, and in configurations that support platform 8.3.10 and higher, you can edit the rules using an extension.
  • You need to transfer data from your own custom configurations. For study purposes, can I use KD3? If you are asking this question, it is most likely impossible. For KD3, the configuration must include BSP 2.3 and higher with synchronization via a universal format. KD2 will suit you 100%, KD3 is questionable.
  • Is it possible to use KD3 for standard modified configurations? Yes, you can. If your non-standard data can be transmitted using ED or the AdditionalInfo attribute, then good. Otherwise, there is an option to change the exchange format (XML schema). In this case, the capabilities of KD3 will be almost equal to KD2, but the main advantage of KD3 - the universality of the exchange format - will disappear.
  • Can ED-enabled configurations be exchanged with each other? Yes! But for the exchange of BP 3.0 - BP 3.0, when creating synchronization, you cannot select BP 3.0. No problem, select “Other program”. If you need a one-time exchange, just use the “Upload Upload EnterpriseData” processing in the All functions menu.
  • After updating the configuration, do you need to download the latest rules from the distribution kit? No! The rules are contained in the configuration module. To exchange with other 1C databases, you do not need to download the rules of another database. Why? Details in this article.
  • After updating one database, do you need to bring the other database participating in the exchange up to date? No! There is no need to synchronously update all databases participating in the exchange. This is one of the advantages of KD3.
  • Our configurations have been greatly improved, there are new types of documents and reference books, can KD3 transfer them? There is a possibility that it won’t be able to without changing the format. This is one of the "disadvantages" of KD3 compared to KD2.

Why then do we need KD3? Advantages and disadvantages

Pros of KD3

Let's look at the main advantage of CD3 using the example of a frequently encountered task. There is a UT 11.3 configuration that is not updated for some reason. It is necessary to organize an exchange with BP 3.0, which is constantly updated to the current release.

No problem.

  • The universal exchange format used in CD3 is designed to solve such problems.
  • Exchange rules in UT are created not for exchange with the BP, but for exchange with the universal EnterpriseData format.
  • If we operate in terms of CD2, then the UT exchanges with the ED configuration, which does not change. BP 3.0 also exchanges with ED.

Each configuration has its own rules for exchange with ED. Thus, the UT always uploads data into the same format. The BP 3.0 configuration, no matter how new it is, must be able to accept data from this format.

It turns out that in the UT there is no need to worry about the fact that the BP changes some details. The task is simple - upload to ED, and the power supply configuration must be able to accept data from this format.

  • Due to the fact that the source configuration always uploads in one format, any receiver configuration can load data from this universal format.
    Those. for an arbitrary combination of exchanges UT - BP, UT - KA, UT - ERP, KA - BP, ERP - BP. no need to write individual rules. In KD3 the rules are universal. Any configuration that supports exchange in the universal format can exchange with any configuration that supports the ED format.

Debugging of algorithms and rules is available in the configuration itself, because all rules are code from a common module or external processing. You can do without CD3 to quickly correct the error.

Cons of KD2

The exchange rules are individual for each pair of configurations. All of the above combinations of exchange between different types of configurations and different versions of configurations require their own exchange rules. Therefore, to solve the above problem of exchanging UT 11.3 and BP 3.0, it will be necessary to debug and refine the exchange rules after almost every update of BP 3.0.

Debugging algorithms and rules is difficult for a novice programmer or for someone who rarely encounters this task. The rules are stored in an xml file. A quick fix is ​​not available. It is necessary to load the rules into CD2, correct them and upload them back.

Cons of KD3

The universal format imposes restrictions on the types of documents and reference books. It is designed for typical configurations. If you have non-standard details or type of document, difficulties may arise during the exchange.

To implement ED synchronization, the configuration must support these mechanisms. All this is in BSP 2.3 and higher. This isn't really a minus, it's more of a feature.

The main advantage fades a little due to the limited time frame for supporting the format. This has already been experienced by users of UT 11.1, UT 11.2, who exchange with BP 3.0. Support periods are listed at this link. It says that the minimum guaranteed period of support for the format is a year, in fact about 3 years. Thus, if you set up synchronization today, then you can not update the UT 11 database for at least a year, and then either update the configuration, or simply add a new format, make a small change to the BSP and the rules if necessary. How to do it? Will be specified later in this article.

Pros of KD2

The possibilities of KD2 are endless. You can create exchange rules for any configuration on any platform. From 1C 7.7 to the latest 8.3. Nothing is required from the configuration, BSP is not required. Rules can be created automatically and modified.

In connection with the above pros and cons, it is recommended to use KD3 for typical configurations. KD2 can be used for any configuration, but given its disadvantages, do not forget that sometimes it is more advisable to use KD3.

I hope we understand why KD3 is needed, let’s continue on the merits.

Accepted abbreviations below

BSP- Library of standard subsystems.
UNDER- data processing rule.
PKO- object conversion rule.
PKPD- rule for converting predefined data.
PKS- property conversion rule.

Let's consider an example - it is necessary to change the standard rules for the exchange of BP 3.0 and UT 11.3

The steps from the instructions, which open in CD3, are indicated on a yellow background. The sequence of steps proposed in this article is different, so as not to get confused and immediately logically complete the action started.

How to change ED rules?
  1. Modify the module with exchange rules directly in the configuration. We are not considering this option yet, because... To understand what needs to be changed and where, you need to do it at least once in CD3. In this case, it will be easier in the future to quickly solve problems, debug them in the module and transfer them to CD3 if necessary.
  2. Use KD3.
    How is this done in KD2? We unload the metadata of both configurations and load it into CD2.
    Step 1. For KD3 we do the same - in each configuration in enterprise mode by processing \tmplts\1c\Conversion\3_0_5_3\MD83Exp.epf upload configuration metadata,
    for example, in the folder " D:\Rules BP3\BP 3.0.54.15\", file name " MD.xml».

It is unclear for what purpose the settings for this processing are hidden; as a result, by default, data in information registers is not uploaded. Let's eliminate this shortcoming.
In the ChangeProcessingMode() procedure of the main form, comment out the line

// Elements.Settings.Visibility = False;

We save the processing, open it in enterprise mode, set the flag to “Unload information registers”, and unload it.

Step 3. Load the previously created file " MD.xml" in KD3, section flag " To the new version of the configuration».

Because in KD3, an “intermediate configuration” (ED) is used for exchange; we also load its “metadata”, which is an XML schema, a file with the extension “xsd”. Step 2. You can take it from the UT 11 or BP 3.0 configuration. They are the same. Open the configuration, enter “ enter", we see in the tree General - XDTO packages packages like this: EnterpriseData_1_3_8, EnterpriseData_1_4_4 and similar.. These are format versions 1.3 and 1.4, respectively, and 1.2, 1.1, 1.0 if available. Right-click on the package and select “” from the context menu.

Step 4. In the CD3 section, select previously uploaded files with the extension “xsd”. You need to select one file! Multiple choice with ExchangeMessage is not needed! This was suggested in the old KD3 instructions of previous versions. In the latest CD3 this is not required.

After loading the format in the section Data Format - Format Object Tree, select a format version. If there are documents and reference books there, then you have uploaded the correct file. If not, start over with a new blank CD3 and first load the format and check the tree.

Stage 2. After loading the metadata into CD3, we proceed to loading standard exchange rules.
How is this done in KD2? The rules are loaded into the conversion.
It's almost the same in KD3. We unload the rules from the standard one, create a conversion, and then load the rules into it.

Unloading standard rules from the configuration for loading into CD3

Configurations are exchanged using the maximum common version of the exchange format. For example, one configuration has a maximum format of 1.5, another 1.6, which means they will exchange each other in 1.5 format. Therefore, it is enough to unload the 1.5 format from both configurations and load it into the rules.

We open the configuration of BP 3.0 or UT 11.3 in configurator mode, in the search bar you can enter “ men uni", open the general module. If this is BP 3.0, then open . In the open module, go to the menu File - Save a copy, save the file with an arbitrary name, for example, “ D:\Rules BP3\BP 3.0.54.15\General module Exchange Manager Through the Universal Format_ Module».
Open the configuration of BP 3.0 or UT 11.3 in enterprise mode, open processing \tmplts\1c\Conversion\3_0_5_3\Uploading synchronization rules.epf

Disadvantage of typical processing:

  • often fails;
  • unloads rules from external processing connected to the node, but we need standard rules;
  • does not work in BP 3.0.53 and higher.

Improvement of the module of the main processing form. We make changes to procedures When CreatedOnServer.

&OnServerProcedureWhenCreatingOnServer(Failure, StandardProcessing) // List of format version selection. FormatVersions = New Match; DataExchangeOverridable.OnReceivingAvailableFormatVersions(FormatVersions); For Each ExchangePlan From DataExchangeRe-UseExchangePlansBSP() Loop If DataExchangeRepeatThisExchangePlanXDTO(ExchangePlan) Then ExchangePlanFormatVersions = New Match; VersionBSP243 = General PurposeClientServer.CompareVersions(StandardSubsystemsServer.LibraryVersion(), "2.4.3.1") >= 0; ModuleDataExchangeServer = GeneralPurpose.GeneralModule("DataExchangeServer"); If VersionBSP243 Then ExchangePlanFormatVersions = Data ExchangeModuleServer.CommunicationPlanSettingsValue(ExchangePlan, "ExchangeFormatVersions"); ElseExchangePlans[ExchangePlan].GetExchangeFormatVersions(ExchangePlanFormatVersions); endIf; For Each ExchangePlanVersion From ExchangePlanFormatVersion CycleModuleManager = FormatVersions.Get(ExchangePlanVersion.Key); If ManagerModule = Undefined Or ManagerModule<>ExchangePlanVersion.Value ThenFormatVersions.Insert(ExchangePlanVersion.Key, ExchangePlanVersion.Value); endIf; EndCycle; endIf; EndCycle; For Each FormatVersion FROM FormatVersion Cycle Elements.FormatVersionNumber.SelectionList.Add(FormatVersion.Key); EndCycle; FormatVersionStorageAddress = PlaceInTemporaryStorage(FormatVersions, UniqueIdentifier); EndProcedure

  • Select “Format version number”, for example, “ 1.3 »,
  • “Exchange directory” - create a folder, for example, “”
  • Press the button " Unload».

We repeat these steps for other versions of the format and save them to the appropriate folders “1.4”, “1.5”, etc. For BP 3.0 it is enough to download all formats from 1.3 and higher. For other configurations from 1.2 and higher.

The rules have been downloaded, now you need to load them into CD3. In KD2, the rules are loaded simultaneously with the creation of the conversion. In KD3 you need to create a conversion and load the rules into it.
In KD3 Section Conversions - Conversions - Create. . Select a configuration. For convenience, you can change the name of the configuration by going to the element editing mode. For example, instead of AccountingEnterprises indicate " BP 3.0.54.15" Props Name no need to change! Name conversions can be specified in the same way, for example, “ BP 3.0.54.15" In the tabular section, select the supported format versions. The format versions are those that we downloaded from the database above. Save the conversion.

Go to the section Conversion - Loading synchronization rules from files.
:

    Loading location: " To existing conversion»

    Exchange directory: " D:\BP3 rules\BP 3.0.54.15\1.3»

  • File with exchange module: " D:\Rules BP3\BP 3.0.54.15\General module Exchange Manager Through Universal Format13_ Module.txt»
  • Conversion: " BP 3.0.54.15»

When loading synchronization rules from files for UT 11.3, an error appears " Object field not found". Reason - for TekPKO.UseToReceive=False KD3 requires information on the identification option upon receipt. If this is not in the rules file, an error occurs. We correct this misunderstanding. Either remove this form from support, or use the extension.

// The main form of processing Loading Synchronization Rules From Files // Before making changes: // The procedure loads the rules for converting objects &On the Server Procedure LoadPKO() ... Fill inPropertyValues(TechPKO, AttributeStructure); // Identification option - special logic. TechPKO.Identification Option = Enumerations.Object Identification Options[Attribute Structure.Identification Option]; ElseIf ReadXML.NodeType = XMLNodeType.EndElement Then // Write the loaded software. ... // Changes are marked "//ED" // The procedure loads object conversion rules &On the Server Procedure LoadPKO() ... FillPropertyValues(TechPKO, AttributeStructure); // Identification option - special logic. If TechPKO.UseToReceive Then //ED TechPKO.IdentificationOption = Enumerations.ObjectIdentificationOptions[AttributeStructure.IdentificationOption]; endIf; ElseIf ReadXML.NodeType = XMLNodeType.EndElement Then // Write the loaded software. ...

Press the button " Download». « The handlers are intended for another conversion: BP 3.0.44 (format 1.4). Continue downloading?» Click « Yes».
Without closing the form, select another “ Exchange directory" and press the " " button. We repeat loading the rules for each format into the current conversion several times.
After successful download, go to the section “ Conversions" - "Setting up conversion rules", open our conversion from the list form.
If we see , POD, etc., then the loading into CD3 was successful.

Checking that the rules are loaded correctly

This is an optional operation! If you use one version of the format in the rules, you do not need to ensure that the module text is identical.

  • Open the BP configurator, create a new external processing, for example, Name " Synchronization EDBP", synonym " Synchronization ED BP 3.0».
  • In KD3 in the form " Setting up exchange rules"Press the "" button and paste this code from the clipboard into our new processing.
  • In the power supply configurator we check the module for syntax errors. We save the processing.
  • create another empty processing in the BP, for example, Name " Synchronization EDBP typical", synonym " Synchronization ED BP 3.0 typical" Copy the text of the general BP module ManagerExchangeThroughUniversalFormat13 into the processing module and save it.

Let's compare both treatments. Menu File - Compare files.

If a standard module contains procedures that are not in our rules, it means that you have not loaded the rules into the conversion for all data formats. If necessary We load the rules in the missing format into the conversion and repeat the comparison of our rules with the standard ones. When you achieved identity you can safely start modifying the rules. It is not necessary to achieve complete identity if you know which exchange format will not be used during synchronization.

In a similar way, we create a conversion for UT 11.3 in KD3.

BP 3.0.54.15

  • Incorrect loading of the software was detected " Directory_Users". Needs to be corrected. Must.
  • In PKO " Document_Inventory of Goods_Dispatch"for PKS" Responsible Person" the software is not specified. Open, reselect the configuration property and the format property so that their type is filled in, after which a choice will be available in the field " Property conversion rule". Select " Directory_Individuals_Dispatch".

Let's look at an example of modification

The main purpose of the example is to show the possibility of modifications to transfer additional data that does not fit into the exchange format.

It is necessary to transfer the props" TypeNomenclature" directory "Nomenclature", type of attribute " Directory.TypesNomenclature". This type of directory is not carried over by the standard rules of KD3 and is not supported by the ED format version below 1.6.

There are several options for solving this problem

  • Improvement of the XDTO package, adding the object "Directory.Types of Nomenclature" to the format. As a result, the main advantage of the universal format is lost - it ceases to be universal. Improvement of the XDTO package will be required in all databases participating in the exchange.
  • Use the format property " Additional details", which is found in many objects. We will not consider this option in this article due to some complexity. Let us take into account that there is such a method.
  • Props AdditionalInfo. It is present in the header of all format objects. Type anyType. Designed for such cases. Let's use it as the simplest way.

Before we begin finalizing the standard rules, let’s create two groups in the rules group “ Added», « Changed" This is done in " Conversions -".
New AML, software, algorithms, etc. We will create in the “Added” group, typical objects to which we make changes and transfer them to the “Changed” group. This will make it easier to maintain the changed rules later.

So let's get started.

Rule changes in UT 11.3

In KD3 in the form " UT 11.3.4.12 Setting up exchange rules» on the tab Algorithms creating a new algorithm

  • Algorithm name “AdditionalInfoInsert”
  • Group: "Added"

Parameters: “XDTO Data, Name, Additional Value”

Algorithm code

If DataXDTO.Property("AdditionalInfo") AND TypeValue(DataXDTO.AdditionalInfo) = Type("Structure") Then AdditionalData = DataXDTO.AdditionalInfo; Otherwise AdditionalData = New Structure; endIf; AdditionalData.Insert(Name, AdditionalValue); DataXDTO.Insert("AdditionalInfo", AdditionalData);

Save the algorithm and go to the “ tab Object conversion rules»

By the button " Find» look for “Nomenclature”, open the PKO « Directory_Nomenclature_Dispatch" Go to the tab " When sending" There we see the field “Handler name:” “”. You can make changes directly there.
More complex code that requires debugging can be written in the configuration. We are looking for a procedure in the exchange module in UT 11.3 with the name “ PKO_Directory_Nomenclature_Sending_WhenSendingData"and we finalize it there.
To transfer changes from UT 11.3 to KD3, copy the entire procedure to the clipboard, in KD3 in the form “ Setting up exchange rules"Press the button "".

For our example, the code is like this

If Value is Filled(IB Data.Item Type) Then //ED AdditionalInfoInsert(XDTO Data, "Item Type", Line(IB Data.Item Type.UniqueIdentifier())); AdditionalInfoInsert(XDTO Data, "Item TypeName", General Purpose.Object Attribute Value(IB Data.Nomenclature Type, "Name")); // AdditionalInfoInsert... //add other service details EndIf;

After transferring the changes to CD3, press the button " Save exchange manager module" and transfer the code from the buffer to the UT 11.3 module.

Rule changes in BP 3.0

We are making changes to the PKO " Directory_Nomenclature_Receipt", on the " tab When converting XDTO data", procedure name " PKO_Directory_Nomenclature_Receipt_During Data ConversionXDTO".

Code added to the module "PKO_Directory_Nomenclature_Receipt_WhenConvertingDataXDTO"

If DataXDTO.Property("AdditionalInfo") AND TypeValue(DataXDTO.AdditionalInfo) = Type("Structure") Then //ED AdditionalData = DataXDTO.AdditionalInfo; If AdditionalData.Property("Item Type") Then Nomenclature Type = Data ExchangeXDTOServer.ObjectLink By ObjectUIDXDTO(AdditionalData.Nomenclature Type, Type("DirectoryLink.Nomenclature Types"), Exchange Components); If Item Type.GetObject() = Undefined And AdditionalData.Property("Nomenclature TypeName") Then //Create a new Nomenclature TypeObject = Directories.Nomenclature Types.CreateElement(); ItemTypeObject.SetLinkNew(NomenclatureType); Nomenclature TypeObject.Name = Additional Data.Nomenclature TypeName; // fill in other service details FillPropertyValues(NomenclatureTypeObject,AdditionalData); NomenclatureTypeObject.Write(); Item Type = Nomenclature TypeObject.Link; endIf; ReceivedData.ItemType = ItemType; endIf; endIf;

Code alone is not enough. It is necessary to add a PCS with the configuration property " " and the checkbox " on the "Property Conversion Rules" tab Conversion algorithm used".

We transfer the exchange manager module to the BP 3 configuration module or to external processing.

How to load the modified KD3 rules into the database?

In configurations that exchange rules on CD2, this is done in the node settings. For rules created in CD3, we will only see the opportunity to change the registration rules.

Rules prepared in KD3 can be installed in the configuration in three ways

  1. Remove the configuration from support and make changes to the common module Exchange Manager Through Universal Format;
  2. On configurations running in compatibility mode with platform 8.3.10 and higher, you can make corrections to the common module using an extension.
  3. Connect an extension that completely replaces the general module with rules.
  4. Without removing the configuration from support, connect external processing with rules to the node;

With the first option everything is clear, it is described in the documentation, the drawback is that you need to remove the configuration from support. The second option - correcting the selected procedure with an extension will also not be difficult for the 1C programmer - it is necessary to compare two treatments with standard rules and with those modified as described above in this article, and make a change to the desired procedure.

Third option - using an extension with exchange rules in a universal format currently the most optimal. There is only one drawback so far - you need to uncheck the "Safe Mode" flag when connecting this extension. This limits its use in cloud services. We are waiting for a decision from 1C on the procedure for replacing the exchange rules in a universal format in 1C Fresh.

The point is that you need to find a section of code in the configuration that is responsible for selecting a common module depending on the version of the exchange format and replacing the selection of the module with your own module. Example for BP 3.0.67:

//////// // General module Data Exchange Overridden &Instead of ("On Receiving AvailableFormatVersions") Procedure ED_WhenReceivingAvailableFormatVersions(FormatVersions) ED_DataExchangeServer.WhenReceivingAvailableFormatVersions(FormatVersions); End of Procedure //////// // Exchange Plan Data Synchronization Through Universal Format: Manager Module #If Server Or Thick Client Normal Application Or External Connection Then &Instead of ("When Receiving Settings") Procedure ED_When Receiving Settings (Settings) Settings.SourceConfigurationName = GeneralPurposeBP.SourceConfigurationName() ; Settings.ThisExchangePlanXDTO = True; Settings.Warn ABOUT ExchangeRule Version Mismatches = False; Settings.ExchangeFormat = "http://v8.1c.ru/edi/edi_stnd/EnterpriseData"; FormatVersions = New Match; ED_DataExchangeServer.WhenReceivingAvailableFormatVersions(FormatVersions); //ED Settings.ExchangeFormatVersions = FormatVersions; Settings.ExchangePlanUsedInServiceModel = True; Settings.Algorithms.WhenReceivingExchangeSettingsOptions = True; Settings.Algorithms.WhenReceivingOptionDescriptionSettings = True; Settings.Algorithms.ViewSelectionInteractiveUpload = True; Settings.Algorithms.Configure Interactive Upload = True; EndProcedure #EndIf //////// // General module in the ED_Data ExchangeServer extension Procedure When Receiving AvailableFormatVersions(FormatVersions) ExportFormatVersions.Insert("1.2", ExchangeManagerThroughUniversalFormat); FormatVersions.Insert("1.3", ED_ExchangeManagerThroughUniversalFormat); FormatVersions.Insert("1.4", ED_ExchangeManagerThroughUniversalFormat); FormatVersions.Insert("1.5", ED_ExchangeManagerThroughUniversalFormat); FormatVersions.Insert("1.6", ED_ExchangeManagerThroughUniversalFormat); End of Procedure //////// // Common module in the ED_Exchange Manager Through the Universal Format extension // Conversion of BP 3.0.44 (format 1.6) from 11/27/2018 11:23:58 // Revision for BP 3.0.67.x from 12/31... .

Let's consider the 4th option, which is not described in the documentation, because there is no such possibility in BSP. This option is already outdated. External processing with rules used in the first versions with a universal exchange format. Now 1C is gradually getting rid of this functionality.

In enterprise mode, in the administration section, follow the link Data Sync - Data Sync Settings, press the button " Tune..."if there is only one setting or " Change", if there are several settings. Go to the form editing mode through the menu " " , Expand " Group", there we include a hidden form element " ", " OK".
On the "tab" Service information"choose" Path to exchange manager", we substitute our processing with the rules there.

Connecting external processing with rules to BP 3.0.52 and higher

In BP 3.0.52 and higher, for unknown reasons, external processing with rules is not used. The interface for connecting processing remains. At least thanks for that.

You can enable processing with rules using an extension. A correction needs to be made to the common module" Data ExchangeXDTOServer", function " Exchange Format Versions".

Procedure EDm_GetExchangeFormatVersion(FormatVersions, InformationBaseNodeValue) Request = New Request("SELECT VARIOUS | Data SynchronizationThroughUniversalFormat.PathToExchangeManager AS PathToExchangeManager, | Data SynchronizationThroughUniversalFormat.ExchangeFormatVersion AS VersionF Exchange Format | FROM | Exchange Plan. Data Synchronization Through the Universal Format HOW to Data Synchronization Through the Universal Format | WHERE | Data Synchronization Through the Universal Format. Path to the Exchange Manager<>"""" | And Data SynchronizationThrough the UniversalFormat.Link = &Link"); Request.SetParameter("Link", InformationBase Node); Selection = Request.Execute().Select(); While Selection.Next() Loop ProcessingName = Selection.PathToExchangeManager; If NOT General PurposeClientServer.DebugMode () Then Processing Data = New Binary Data (Processing Name); Processing Address = Place in Temporary Storage (Processing Data); addressProcessing); End If; change = New Match; If ValueFilled(InformationBaseNode) Then ExchangePlanName = InformationBaseNode.Metadata().Name; ExchangeFormatVersions = Data ExchangeServer.ExchangePlanSettingsValue(ExchangePlanName,"ExchangeFormatVersions"); EDm_GetExchangeFormatVersion(ExchangeFormatVersions, InformationBase Node); Otherwise, DataExchangeOverridden.WhenReceivingAvailableFormatVersions(ExchangeFormatVersions); endIf; If ExchangeFormatVersions.Quantity() = 0 Then Call Exception StringFunctionsClientServer.Substitute ParametersIntoString(NStr("ru = "No exchange format versions are specified. |Exchange plan name: %1 |Procedure: Get ExchangeFormatVersions(<ВерсииФорматаОбмена>)""), InformationBaseNode.Metadata().Name); endIf; Result = New Match; For Each Version From Exchange Format Version Loop Result.Insert(AbbrLP(Version.Key), Version.Value); EndCycle; Return Result; EndFunction

How to Debug Rules in External Processing

    In the configurator" Service -> Options -> Launch 1C:Enterprise -> Launch option", specify the parameter " ".

  • Below is the code for the extension, for UT 11.4, KA 2.4, ERP 2.4. The code for BP 3.0 is given above. Exchange plan manager module Data Synchronization Through a Universal Format.

Extension code EDdebugging

&Instead of("GetExchangeFormatVersions") Procedure ED_GetExchangeFormatVersions(FormatVersions) UT Data Exchange.AvailableVersionsofUniversalFormat(FormatVersions); Request = New Request("SELECT DIFFERENT | Data SynchronizationThrough the UniversalFormat.PathToExchangeManager, |Data SynchronizationThroughUniversalFormat.ExchangeFormatVersion |FROM |ExchangePlan.DataSynchronizationThroughUniversalFormat HOW Data SynchronizationThroughUniversalFormat | WHERE | Data SynchronizationThroughUniversalFormat mat.PathToExchangeManager<>"""""); Selection = Query.Execute().Select(); While Selection.Next() Loop ProcessingName = Selection.PathToExchangeManager; If NOT General PurposeClientServer.DebugMode() Then //ED ProcessingData = New BinaryData(ProcessingName) ; ProcessingAddress = PlaceInTemporaryStorage(ProcessingData.ThereisProtectionFromDangerousActions()) ThenProcessingName = ExternalProcessing.Connect(ProcessingAddress, GeneralPurpose.ProtectionDescriptionWithoutWarnings()); = ExternalProcesses.Create( ProcessingName); FormatVersions.Insert(Selection.ExchangeFormatVersions, ExchangeManager); EndProcedure &Instead("AvailableExchangeFormatVersions") Procedure ED_AvailableExchangeFormatVersions(FormatVersions) UT Data Exchange.AvailableVersionsofUniversalFormat a); Request = New Request("SELECT DIFFERENT | Data SynchronizationThroughUniversalFormat.PathToExchangeManager, | Data SynchronizationThroughUniversalFormat.VersionExchangeFormat |FROM | Exchange Plan. Data Synchronization Through the Universal Format HOW to Data Synchronization Through the Universal Format | WHERE | Data Synchronization Through Universal Format.PathToExchangeManager<>"""""); Selection = Query.Execute().Select(); While Selection.Next() Loop ProcessingName = Selection.PathToExchangeManager; If NOT General PurposeClientServer.DebugMode() Then //ED ProcessingData = New BinaryData(ProcessingName) ; ProcessingAddress = PlaceInTemporaryStorage(ProcessingData.ThereisProtectionFromDangerousActions()) ThenProcessingName = ExternalProcessing.Connect(ProcessingAddress, GeneralPurpose.ProtectionDescriptionWithoutWarnings()); = ExternalProcesses.Create( ProcessingName);FormatVersions.Insert(Selection.ExchangeFormatVersion, ExchangeManager);

Debugging is easiest done in a file database. We set a breakpoint in processing with rules. To find the required procedure, we use KD3. We find PKO, POD or Algorithm, look " Handler name" or " Algorithm name", look for this procedure in the rules module. After editing the module, do not forget to copy the procedure to the buffer and press the "" button in CD3. Be careful, the same conversion must be opened.

That's all for now. This information is already enough for a 1C programmer to independently master KD3 and maintain a modern method of synchronization between 1C databases. If there are still blank spots, ask, the article will be supplemented and you can return to it if you forgot something.

Well-known links to documentation on KD3:
  • 1C-Training Center No. 3, "Data Conversion 3.0" - http://www.1c-uc3.ru/konvert30.html
You can expand the scope of application of KD3 using these publications:
  • - configurations of previous versions on platform 8.2 and below are converted into ED compatible.
You can save time and use ready-made rules for the latest versions of configurations here
  • - expanded functionality, bug fixes.
views