Операции для выполнения xml-пакета#
Примечание
Для корректной отправки файла xml, в атрибутах которого используются спецсимволы "
, '
, <
, >
, &
, замените их соответствующей кодировкой:
" "
' '
< <
> >
& &
Операция set#
Операция set служит для присвоения значений полям объекта. Может присваивать как конкретное значение, так и результат других операций, например, find.
Описание в xml-запросе
Образец:
<ПсевдонимПоля operation="set" value="ЗначениеКотороеНужноУстановить" />
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance">
<scheme>
<tyulegenov>Сосногорский МР</tyulegenov>
</scheme>
<Fields>
<Num operation="set" value="test"/>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="ПсевдонимПоля" type="ТипДляПсевдонимаПоля"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляПсевдонимаПоля">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="Num" type="SetTextType" minOccurs="0">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="tyulegenov" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
</xs:schema>
Операция find#
Операция find используется для поиска объекта в Системе по некоторым условиям для их последующего обновления, создания или установления связи между объектами. Операция возвращает ключ найденного или созданного объекта в Системе.
Все варианты операции find можно комбинировать. Если объект найден, его можно отредактировать (find-edit-existing). Если объект не найден, его можно создать (find-create).
Чтобы присвоить ссылочному полю значение (операция set), необходимо предварительно найти его с помощью операции find по указанным условиям. Например, установить в ссылочном поле значение справочника, найти которое можно по его наименованию или псевдониму.
Описание в xml-запросе
Образец:
<ПсевдонимПоля operation="set">
<ПсевдонимОбъекта operation="find">
<Fields>
<ПолеПоКоторомуИщем1 operation="eq" value="ЗначениеПоКоторомуИщем1" />
<ПолеПоКоторомуИщем2 operation="eq" value="ЗначениеПоКоторомуИщем2" />
</Fields>
</ПсевдонимОбъекта>
</ПсевдонимПоля>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance">
<scheme>
<tyulegenov>Сосногорский МР</tyulegenov>
</scheme>
<Fields>
<StateApplication operation="set">
<DocRefStateApplication operation="find">
<Fields>
<Name operation="eq" value="Новое"/>
</Fields>
</DocRefStateApplication>
</StateApplication>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="ПсевдонимПоля" type="ТипДляПсевдонимаПоля"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляПсевдонимаПоля">
<xs:attribute name="operation" type="xs:string" fixed="set" use="required"/>
<xs:sequence>
<xs:element name="ПсевдонимСвязи" type="ТипДляПсевдонимаСвязи"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляПсевдонимаСвязи">
<xs:attribute fixed="find" name="operation" type="xs:string" use="required"/>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="ПолеПоКоторомуИщем">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" use="required" fixed="ЗначениеПоляПоКоторомуИщем" type="xs:string"> </xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="StateApplication" type="StateApplicationType">
<xs:annotation>
<xs:documentation>Статус заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="tyulegenov" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="DocRefStateApplicationType">
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:choice>
<xs:element minOccurs="1" name="Alias">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string"
use="required"/>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="New"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="Name">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string"
use="required"/>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Новое"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="StateApplicationType">
<xs:sequence>
<xs:element name="DocRefStateApplication" type="DocRefStateApplicationType">
<xs:annotation>
<xs:documentation>Справочник "Статус заявления"</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="operation" type="xs:string" fixed="set" use="required"/>
</xs:complexType>
</xs:schema>
Операция eq#
Операция eq может использоваться во всех операциях, которые поддерживаются при работе с API Jasper. Возвращает истину, если значение указанного поля равно значению, описанному в данной операции.
Описание в xml-запросе
Образец:
<ПсевдонимПоля operation="set">
<ПсевдонимОбъекта operation="find">
<Fields>
<ПолеПоКоторомуИщем1 operation="eq" value="ЗначениеПоКоторомуИщем1" />
<ПолеПоКоторомуИщем2 operation="eq" value="ЗначениеПоКоторомуИщем2" />
</Fields>
</ПсевдонимОбъекта>
</ПсевдонимПоля>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="create">
<scheme>
<tyulegenov>Сосногорский МР</tyulegenov>
</scheme>
<Fields>
<Num operation="set" value="32-12"/>
<WaySend operation="set">
<DocRefTransferMethod operation="find">
<Fields>
<Name operation="eq" value="Электронная почта"/>
</Fields>
</DocRefTransferMethod>
</WaySend>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:complexType name="ПсевдонимОбъекта">
<xs:sequence> <xs:element name="scheme" type="schemeType"></xs:element>
<xs:element name="Fields" type="FieldsType"></xs:element>
</xs:sequence>
<xs:attribute fixed="delete" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="key">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" use="required" type="xs:long">КлючОбъекта</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element minOccurs="1" name="Num" type="SetTextType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="WaySend" type="WaySendType">
<xs:annotation>
<xs:documentation>Способ подачи заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="tyulegenov" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="SubjPerson" type="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru">Физическое лицо</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru"/>
</xs:annotation>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="LastName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Фамилия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FirstName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Имя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="WaySendType">
<xs:sequence>
<xs:element name="DocRefTransferMethod" type="DocRefTransferMethodType">
<xs:annotation>
<xs:documentation>Справочник "Способы передачи результата"</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="DocRefTransferMethodType">
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:choice>
<xs:element minOccurs="1" name="Alias">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string"
use="required"/>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="mfc"/>
<xs:enumeration value="epgu"/>
<xs:enumeration value="mail"/>
<xs:enumeration value="email"/>
<xs:enumeration value="inHand"/>
<xs:enumeration value="rpgu"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="Name">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" type="xs:string"
use="required"/>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="МФЦ"/>
<xs:enumeration value="ЕПГУ"/>
<xs:enumeration value="Почтовое отправление"/>
<xs:enumeration value="Электронная почта"/>
<xs:enumeration value="Лично"/>
<xs:enumeration value="РПГУ"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find" name="operation" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>
Операция create#
Операция create служит для создания в Системе объектов, связанных с корневым объектом.
Данная операция создаёт в Системе объект с алиасом ПсевдонимОбъекта
и набором его полей. Поля задаются в параметре Fields
, который может содержать любое количество различных операций.
У корневого элемента в xsd должен быть задан параметр scheme
, который содержит в себе перечень всех схем проекта, доступных для данной xsd.
Описание в xml-запросе
Образец:
<ПсевдонимПоляКорнегогоЭлемента operation="ref">
<ПсевдонимОбъекта operation="create">
<Fields>
<ПсевдонимПоля1 operation="set" value="ЗначениеПоля1"/>
<ПсевдонимПоля2 operation="set" value="ЗначениеПоля2"/>
<Fields>
</ПсевдонимОбъекта>
</ПсевдонимПоляКорнегогоЭлемента>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="create">
<scheme>
<sosnogorsky>Сосногорский МР</sosnogorsky>
</scheme>
<Fields>
<Num operation="set" value="2345"/>
<SubjRoleDeclarer operation="ref">
<SubjPerson operation="create">
<Fields>
<LastName operation="set" value="Сидорова"/>
<FirstName operation="set" value="Юля"/>
</Fields>
</SubjPerson>
</SubjRoleDeclarer>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:complexType name="ПсевдонимОбъектаСвязи">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="ПсевдонимОбъекта" type="ТипПсевдонимаОбъекта">
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="ТипПсевдонимаОбъекта">
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="ПсевдонимПоля1" type="SetTextType">
</xs:element>
<xs:element name="ПсевдонимПоля2" type="SetTextType">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation" type="xs:string" use="required"/>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element minOccurs="1" name="Num" type="SetTextType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubjRoleDeclarer" type="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru">
Данные заявителя
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="sosnogorsky" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="SubjPerson" type="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru">Физическое лицо</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru"/>
</xs:annotation>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="LastName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Фамилия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FirstName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Имя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
</xs:schema>
Операция ref#
Операция ref используется для создания в ссылочных полях связей типа Multi Relation («многие ко многим»). Может использоваться во всех операциях, которые поддерживаются при работе с API Jasper.
Синтаксически операция ref располагается в блоке Fields
одного из связываемых объектов и описывает второй объект внутри себя (поиск или создание).
Описание в xml-запросе
Образец:
<ПсевдонимОбъекта operation="...">
<Fields>
...
<ПсевдонимММСвязи operation="ref">
<ПсевдонимДругогоОбъекта operation="...">
...
</ПсевдонимДругогоОбъекта>
</ПсевдонимММСвязи>
</Fields>
</ПсевдонимОбъекта>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="create">
<scheme>
<tyulegenov>Сосногорский МР</tyulegenov>
</scheme>
<Fields>
<Num operation="set" value="#1001380000094592-1"/>
<SubjRoleDeclarer operation="ref">
<SubjPerson operation="find-create">
<Fields>
<LastName operation="set" value="Иванова" updateField="true"/>
<FirstName operation="set" value="Иванна"/>
<MiddleName operation="set" value="Ивановна"/>
<DocIdentitySeria operation="set" value="1234" keyField="true"/>
<DocIdentityNumber operation="set" value="112233" keyField="true"/>
</Fields>
</SubjPerson>
</SubjRoleDeclarer>
</Fields>
</DocApplication>
Описание в xsd
В xsd-схеме создаётся MR-связь с алиасом ПсевдонимСвязи
между корневым объектом, который описывается типом FieldsType
, и объектом с алиасом ПсевдонимСвязываемогоОбъекта
.
Образец:
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="ПсевдонимСвязи" type="ТипДляСвязи"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляСвязи">
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
<xs:sequence>
<xs:element name="ПсевдонимСвязываемогоОбъекта" type="ТипДляСвязываемогоОбъекта"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляСвязываемогоОбъекта">
<xs:attribute fixed="create" name="operation" type="xs:string" use="required"/>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
...
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="scheme">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice>
<xs:element name="tyulegenov" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Fields">
<xs:annotation>
<xs:documentation/>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="Num" type="SetTextType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="SubjRoleDeclarer"
type="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation>Данные заявителя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="UpdateFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="SubjPerson" type="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru">Физическое лицо</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru"/>
</xs:annotation>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="LastName" type="UpdateFieldType">
<xs:annotation>
<xs:documentation xml:lang="ru">Фамилия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FirstName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Имя</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="MiddleName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Отчество</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="DocIdentitySeria" type="KeyFieldType">
<xs:annotation>
<xs:documentation xml:lang="ru">Серия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="DocIdentityNumber" type="KeyFieldType">
<xs:annotation>
<xs:documentation xml:lang="ru">Номер</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find-create" name="operation" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>
Операция clear#
В операции ref можно также задать атрибут clear
, который может принимать значения true
или false
.
Если значение атрибута задано true
, то у найденного при выполнении xml-пакета объекта Системы будут предварительно удалены установленные ранее связи. После чего выполнится последующее условие, заданное для этого параметра в xml.
Описание в xml-запросе
Образец:
<ПсевдонимОбъекта operation="...">
<Fields>
...
<ПсевдонимММСвязи operation="ref" operation="clear">
<ПсевдонимДругогоОбъекта operation="...">
...
</ПсевдонимДругогоОбъекта>
</ПсевдонимММСвязи>
</Fields>
</ПсевдонимОбъекта>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="find-create">
<scheme>
<sosnogorsky>Сосногорский МР</sosnogorsky>
</scheme>
<Fields>
<Num operation="set" value="1554" keyField="true"/>
<DocAgent operation="set" value="Доверенность №1 от 24.03.2022" updateField="true"/>
<SubjRoleDeclarer operation="ref" clear="true" updateField="true">
<SubjPerson operation="create" >
<Fields>
<LastName operation="set" value="Иванова"/>
<FirstName operation="set" value="Иванна"/>
</Fields>
</SubjPerson>
</SubjRoleDeclarer>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="ПсевдонимСвязи" type="ТипДляСвязи"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляСвязи">
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
<xs:attribute name="clear" type="xs:boolean" use="optional" default="false"/>
<xs:sequence>
…
</xs:sequence>
Пример:
<!--?xml version="1.0" encoding="UTF-8"?-->
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find-create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element minOccurs="1" name="Num" type="KeyFieldType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="DocAgent" type="UpdateFieldType">
<xs:annotation>
<xs:documentation>Документ, подверждающий полномочия заявителя</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubjRoleDeclarer" type="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru">
Данные заявителя
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="sosnogorsky" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="SubjPerson" type="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru">Физическое лицо</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
<xs:attribute default="true" name="clear" type="xs:boolean"/>
<xs:attribute fixed="true" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru"/>
</xs:annotation>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="LastName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Фамилия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FirstName" type="SetTextType">
<xs:annotation>
<xs:documentation xml:lang="ru">Имя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="create" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="UpdateFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
</xs:schema>
Операция find-create#
Операция find-create используется для сценария, когда необходимо найти объект и обновить его поля, или создать новый объект в случае, если его не удалось найти. Эта операция возвращает ссылку на найденный или созданный объект.
Важно
При создании объектов предпочтительно использование операции find-create во избежание создания дубликатов в Системе. Например, перед созданием субъектов следует проверить на соответствие поля [ИНН], [ОГРН] (для юридических лиц), [СНИЛС], [ОГРНИП] (для физических лиц), так как в Системе не должно быть двух субъектов в статусе «Актуальный» с одинаковыми значениями в указанных полях.
Операция find-create идентична комбинации операций find и edit-existing, применяемых совместно, и служит для упрощения записи.
Операция find включает в себя возможность использования дополнительных атрибутов, с помощью которых можно задать условия на поиск объектов и на обновление найденных. Такими дополнительными атрибутами являются keyField
и updateField
.
Если для параметра задан атрибут keyField="true"
, то поиск объектов в Системе будет осуществляться по нему.
Если для параметра задан атрибут updateField="true"
, то у найденного в результате поиска объекта соответствующее поле будет обновлено значением из xml.
Если в результате поиска объектов не найдено, то будет создан новый со всеми указанными полями в xml, вне зависимости от указанных значений атрибутов.
Важно
С операцией find-create не следует использовать поле [Key]. Так как если указанный ключ не будет найден, Система создаст объект именно с этим ключом, тогда как ключи должны генерироваться автоматически.
Описание в xml-запросе
Образец:
<ПсевдонимОбъекта operation="find-create">
<Fields>
<ПсевдонимПоля1 operation="set" value="ЗначениеПоля1" keyField="true"/>
<ПсевдонимПоля2 operation="set" value="ЗначениеПоля2" updateField="true"/>
…
</Fields>
</ПсевдонимОбъекта>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="find-create">
<scheme>
<sosnogorsky>Сосногорский МР</sosnogorsky>
</scheme>
<Fields>
<Num operation="set" value="15" keyField="true"/>
<DocAgent operation="set" value="Доверенность №1 от 24.03.2022" updateField="true"/>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:element name="ПсевдонимОбъекта" type="ТипДляОбъекта"></xs:element>
<xs:complexType name="ТипДляОбъекта">
<xs:attribute fixed="find-create" name="operation" type="xs:string" use="required"/>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="ПсевдонимПоля1" type="ТипДляПоляПоКоторомуПоиск"></xs:element>
<xs:element name="ПсевдонимПоля2" type="ТипДляПоляКотороеОбновляется"></xs:element>
...
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляПоляКотороеОбновляется">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute name="updateField" type="xs:boolean" use="required" fixed="true"/>
</xs:complexType>
<xs:complexType name="ТипДляПоляПоКоторомуПоиск">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="scheme">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice>
<xs:element name="sosnogorsky" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Fields">
<xs:annotation>
<xs:documentation/>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Num" type="KeyFieldType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="DocAgent" type="UpdateFieldType">
<xs:annotation>
<xs:documentation>Документ, подверждающий полномочия заявителя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find-create" name="operation" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="UpdateFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
</xs:schema>
В примере описан поиск объекта по Полю1. В случае, если объект будет найден, то Поле2 будет обновлено на новое значение из xml. В случае, если объект не найден по Полю1, то будет создан новый со всеми полями, указанными в xml.
В корневом теге с операцией find-create можно указать атрибут updateFields
, который изменит режим обновления (по умолчанию – false
) для всех полей.
Описание в xml-запросе
Образец:
<ПсевдонимОбъекта operation="find-create" updateFields="true">
<Fields>
<ПсевдонимПоля1 operation="set" value="ЗначениеПоля1" keyField="true"/>
<ПсевдонимПоля2 operation="set" value="ЗначениеПоля2" updateField="false"/>
…
</Fields>
</ПсевдонимОбъекта>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="find-create" updateFields="true">
<scheme>
<sosnogorsky>Сосногорский МР</sosnogorsky>
</scheme>
<Fields>
<Num operation="set" value="15" keyField="true"/>
<DocAgent operation="set" value="Доверенность №1 от 24.03.2022" updateField="false"/>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:element name="ПсевдонимОбъекта" type="ТипДляОбъекта"></xs:element>
<xs:complexType name="ТипДляОбъекта">
<xs:attribute fixed="find-create" name="operation" type="xs:string" use="required"/>
<xs:attribute name="updateFields" type="xs:boolean" use="required" fixed="true"/>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="ПсевдонимПоля1" type="ТипДляПоляПоКоторомуПоиск"></xs:element>
<xs:element name="ПсевдонимПоля2" type="ТипДляПоляКотороеНеОбновляется"></xs:element>
...
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ТипДляПоляКотороеНеОбновляется">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute name="updateField" type="xs:boolean" use="required" fixed="false"/>
</xs:complexType>
<xs:complexType name="ТипДляПоляПоКоторомуПоиск">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="scheme">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice>
<xs:element name="sosnogorsky" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Fields">
<xs:annotation>
<xs:documentation/>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Num" type="KeyFieldType">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="DocAgent" type="UpdateFieldType">
<xs:annotation>
<xs:documentation>Документ, подверждающий полномочия заявителя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find-create" name="operation" use="required"/>
<xs:attribute name="updateFields" type="xs:boolean" use="required" fixed="true"/>
</xs:complexType>
</xs:element>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="UpdateFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="false" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
</xs:schema>
В примере в случае нахождения объекта Поле1 будет обновлено, несмотря на отсутствие в нем атрибута updateField
, так как на всю операцию find-create установлен режим обновления для всех полей – updateFields="true"
.
Поле2 обновлено не будет, так как присутствующий в поле атрибут updateField="false"
переопределяет режим обновления для этого поля.
Операция edit-existing#
Операция edit-existing используется для описания условий только в операции find. Используется для редактирования/обновления существующего объекта Системы.
Описание в xml-запросе
Образец:
<ПсевдонимОбъекта operation="find">
<Fields>
<key operation="eq" value="ключОбъекта"/>
</Fields>
<ПсевдонимОбъекта operation="edit-existing">
<Fields>
<ПсевдонимПоля1 operation="set" value="ЗначениеПоля1"/>
<ПсевдонимПоля2 operation="set" value="ЗначениеПоля2"/>
</Fields>
</ПсевдонимОбъекта>
</ПсевдонимОбъекта>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<DocApplication xmlns="httр://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsi="httр://www.w3.org/2001/XMLSchema-instance" operation="find-create">
<scheme>
<sosnogorsky>Сосногорский МР</sosnogorsky>
</scheme>
<Fields>
<Num operation="set" value="10013800000" keyField="true"/>
<OutNum operation="set" value="100129875" updateField="true"/>
<SubjRoleDeclarer operation="ref" updateField="true">
<SubjPerson operation="find">
<Fields>
<key operation="eq" value="1001380000094609"/>
</Fields>
<SubjPerson operation="edit-existing">
<Fields>
<LastName operation="set" value="Сидорова" updateField="true"/>
<FirstName operation="set" value="Юлия" updateField="true"/>
</Fields>
</SubjPerson>
</SubjPerson>
</SubjRoleDeclarer>
</Fields>
</DocApplication>
Описание в xsd
Образец:
<xs:element minOccurs="1" name="ПсевдонимОбъекта" type="ТипПсевдонимаОбъекта">
</xs:element>
<xs:complexType name="ТипПсевдонимаОбъекта">
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="key">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ПсевдонимОбъекта">
<xs:complexType>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="ПсевдонимПоля1" type="UpdateFieldType">
</xs:element>
<xs:element name="ПсевдонимПоля2" type="UpdateFieldType">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="edit-existing" name="operation" type="xs:string"
use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find" name="operation" type="xs:string" use="required"/>
</xs:complexType>
Пример:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="httр://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
vc:minVersion="1.1" xmlns:vc="httр://www.w3.org/2007/XMLSchema-versioning">
<xs:element name="DocApplication" type="DocApplicationType">
<xs:annotation>
<xs:documentation>Заявление</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="DocApplicationType">
<xs:sequence>
<xs:element name="scheme" type="schemeType">
<xs:annotation>
<xs:documentation>Схема проекта</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Fields" type="FieldsType">
<xs:annotation>
<xs:documentation>Параметры заявления</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find-create" name="operation"/>
</xs:complexType>
<xs:complexType name="FieldsType">
<xs:sequence>
<xs:element name="Num" type="KeyFieldType" minOccurs="0">
<xs:annotation>
<xs:documentation>Номер заявления</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" name="OutNum" type="UpdateFieldType">
<xs:annotation>
<xs:documentation>Исходящий номер</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubjRoleDeclarer" type="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru">
Данные заявителя
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetTextType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="schemeType">
<xs:choice>
<xs:element name="sosnogorsky" fixed="Сосногорский МР"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ApplicationDeclarerRelationType">
<xs:annotation>
<xs:documentation xml:lang="ru"> </xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element minOccurs="1" name="SubjPerson" type="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru">Физическое лицо</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:attribute fixed="ref" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="SubjPersonType">
<xs:annotation>
<xs:documentation xml:lang="ru"/>
</xs:annotation>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="key">
<xs:complexType>
<xs:attribute fixed="eq" name="operation" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubjPerson">
<xs:complexType>
<xs:sequence>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="LastName" type="UpdateFieldType">
<xs:annotation>
<xs:documentation xml:lang="ru">Фамилия</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FirstName" type="UpdateFieldType">
<xs:annotation>
<xs:documentation xml:lang="ru">Имя</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="edit-existing" name="operation" type="xs:string"
use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute fixed="find" name="operation" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="KeyFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="keyField" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="UpdateFieldType">
<xs:attribute fixed="set" name="operation" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute fixed="true" name="updateField" type="xs:boolean" use="required"/>
</xs:complexType>
</xs:schema>
В Системе по ключу (поле [Key]) ищется объект с алиасом ПсевдонимОбъекта
, для которого устанавливаются нужные значения полей.
Если нужно сменить значение поля, которое является ссылочным, например, справочник, то сначала необходимо методом find найти ключ справочного значения. Это можно сделать по его наименованию или псевдониму.