Data conversion version 3.0. Video instructions for conversion

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/

Edition 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 fixed 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.

Attention! Now the course is also held in the evening from 18:30 to 21:30 in an immersion format.

Currently, the “Data Conversion 3.0” configuration has been released. It is important to understand that edition 2.1 has not lost its relevance and is still a tool for implementing one-time exchanges and data overloads. Also, only in edition 2.1 is it possible to develop object registration rules (RO) used in exchanges implemented using CD 3.0. Currently, a specialist involved in data exchange must master both CD 2.1 and CD 3.0.

Purpose of the course: become familiar with the possibilities of organizing exchange between 1C:Enterprise configurations (both “standard” and those developed independently) using the “Data Conversion 3.0” technology (exchange using the “EnterpriseData” format).

Configuration Data conversion 2.1 and 3.0 have fundamental differences. We have prepared a video that describes the differences between these configurations.

The course will cover

  • “Data Conversion 3.0” configuration options for creating or adjusting existing conversions, setting up “Data Conversion 2.1” object registration rules (object registration rules developed in the previous configuration edition are needed for exchange using the “EnterpriseData” format)
  • integration of the training base with the “Library of Standard Subsystems” (it is on the functionality of the “Data Exchange” subsystem that the possibility of exchange through the Universal Format is implemented).

The course is designed for specialists with basic programming skills on the 1C:Enterprise 8 platform. To fully master the material, working skills (configuration and programming) in the managed application “1C:Enterprise 8” are required. These capabilities are covered in the Managed Application course.

Please note that this course discusses the issues of setting up the conversion of data from (to) systems based on the 1C:Enterprise technology platform into and from a universal format. Issues related to exchange with arbitrary systems (using technologies other than exchange through a universal format) are discussed in the course "Integration and Data Exchange".

The price of the WEB course includes:

Training formats

WEB training

What is this format:The proposed format combines many of the advantages of distance learning with a face-to-face component represented by video materials and online consultations.
The WEB course consists of videos, practical tasks and webinars with teachers. All course materials are available 24/7 via the Internet so you can study at a time that suits you. The course is divided into classes. During the lesson, materials on the current topic are studied, workshops are performed, and questions are asked to the teacher. At the end of each lesson, a webinar is held, during which the teacher examines all the questions received, typical errors, and explains the correct solution. Recordings of webinars are available in the portal. In this way, several classes are held one after another. At the end there is a final independent work and a final webinar.

Duration: 5 weeks

What is this format:


Duration:40 academic hours

What is this format:A full-time immersion course is a format that combines all the advantages of full-time training, distance learning and individual training. Classes are held in an equipped classroom, you independently study the course materials (step-by-step videos) and perform workshops. At the same time, there is a teacher in the audience who is ready at any time to answer questions and help with solving practical problems, as well as check the correctness of their implementation.
Advantages – individual consultations from the teacher on your questions, the pace of completing the material is suitable for you personally.
All this provides a more in-depth study of the course material.
This course can be taken from your workplace with the full effect of the presence of the teacher where the student is! If this opportunity interests you, give us a call!

Duration:40 academic hours

Course program

Course program

Introduction

Features of the use of new exchange technology

Presets

Setting up conversion rules

  • Transferring a Simple Object (Preliminary Preparation)
  • Setting up configuration synchronization
  • Setting up a predefined data conversion rule
  • Transferring a complex directory (preparatory stage)
  • Transfer of hierarchical data
  • Different number of hierarchy levels
  • Transfer of additional data
  • Using additional details
  • Data synchronization
  • Register of information “Public identifiers of synchronized objects”
  • Transfer of documents
  • Lazy data processing
  • Delayed posting of documents, use of parameters
  • Transfer of balances (arbitrary algorithms)

Setting up object registration rules

Integration with a library of standard subsystems

  • General provisions
  • Subsystem "Data exchange"
  • Integration with the “Data Exchange” subsystem

Technical requirements:

  • Internet access (you can check your communication channel by connecting to),
  • availability of the 1C:Enterprise 8.3 platform (not lower than 8.3.6) for practicing practical course assignments.

You can use "1C:Enterprise 8". Version for learning programming.
- electronic (free) delivery on platform 8.3,

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 exchanging 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 enable 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 indicated follow 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 them into CD2.
    Step 1. For KD3 we do the same - in each configuration in enterprise mode, 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 “xsd” extension. 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 the format version. If there are documents and reference books there, then you have uploaded the correct file. If not, start over with a new empty 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); 1.3 »,
  • 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);. . 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);

VersionBSP243 = General PurposeClientServer.CompareVersions(StandardSubsystemsServer.LibraryVersion(), "2.4.3.1") >= 0; // 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. ... 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 “
If we see , POD, etc., then the loading into CD3 was successful.

Checking that 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"Click 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"PKO 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 " 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();

  1. Item Type = Nomenclature TypeObject.Link; Exchange Manager Through Universal Format;
  2. endIf;
  3. ReceivedData.ItemType = ItemType;
  4. 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 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;", 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 ProcessingData = New BinaryData(ProcessingName); ProcessingAddress = PutInTemporaryStorage(ProcessingData); 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;

&Instead of("GetExchangeFormatVersions") Procedure ED_GetExchangeFormatVersions(FormatVersions) UT Data Exchange.AvailableVersionsofUniversalFormat(FormatVersions);<>Request = New Request("SELECT VARIOUS | Data SynchronizationThrough the UniversalFormat.PathToExchangeManager, |Data SynchronizationThroughUniversalFormat.ExchangeFormatVersion |FROM |ExchangePlan.DataSynchronizationThroughUniversalFormat HOW To SynchronizeDataThroughUniversalFormat | WHERE | SynchronizeDataThroughUniversalFormat 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()); = ExternalProcessing.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:
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.