mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-13 22:35:16 +03:00
feat(meta-compile,meta-decompile): поддержка BusinessProcess + Task (v1.48/v0.40)
Одиннадцатый и двенадцатый типы — ссылочные (БП/Задачи, 25+3 объекта). Оба закрыты modulo принятый empty-DTR хвост: BusinessProcess 20/25 (остаток empty-DTR), Task 1/3 (остаток empty-DTR на 2 объектах). Регресс 49/49 ps1+py, ps1==py identical (0/20 modulo GUID). 1С-cert ✓ оба. BusinessProcess: - Рерайт Emit-BusinessProcessProperties на общие хелперы в каноническом порядке (был легаси-хардкод: Comment/Characteristics/BasedOn/формы/DataLockFields пустые, порядок неверный, пропущены NumberPeriodicity/CreateTaskInPrivilegedMode). Class-2: DataLockControlMode Automatic→Managed. - Декомпилятор: снят гейт; BP-блок (нумерация/task/createTaskInPrivilegedMode); basedOn/dataLockFields/ characteristics/inputByString уже в общем слое; opt-out standardAttributes:"". - Фикс ref-типа BusinessProcessRoutePointRef (не был в regex d5p1-префикса → терялся cfg:-префикс). Task: - Рерайт Emit-TaskProperties на общие хелперы (порядок + Addressing/MainAddressingAttribute/CurrentPerformer/ TaskNumberAutoPrefix/DescriptionLength/DefaultPresentation). Class-2: DataLockControlMode→Managed. - Новый вид дочернего AddressingAttribute: легаси-эмиттер выдавал 8 тегов вместо ~26 → делегирован на богатый Emit-Attribute (контекст task-addressing) + AddressingDimension. Декомпилятор: захват AddressingAttribute → addressingAttributes. spec §7.6c/§7.6d, кейсы business-process/task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# meta-compile v1.47 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.48 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -582,7 +582,7 @@ function Emit-TypeContent {
|
||||
}
|
||||
|
||||
# Reference types — use local xmlns declaration for 1C compatibility
|
||||
if ($typeStr -match '^(CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|ExchangePlanRef|BusinessProcessRef|TaskRef)\.(.+)$') {
|
||||
if ($typeStr -match '^(CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|ExchangePlanRef|BusinessProcessRef|BusinessProcessRoutePointRef|TaskRef)\.(.+)$') {
|
||||
X "$indent<v8:Type xmlns:d5p1=`"http://v8.1c.ru/8.1/data/enterprise/current-config`">d5p1:$typeStr</v8:Type>"
|
||||
return
|
||||
}
|
||||
@@ -848,6 +848,7 @@ function Parse-AttributeShorthand {
|
||||
balance = if ($val.balance -eq $true) { $true } else { $false }
|
||||
accountingFlag = $val.accountingFlag
|
||||
extDimensionAccountingFlag = $val.extDimensionAccountingFlag
|
||||
addressingDimension = $val.addressingDimension
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1716,6 +1717,10 @@ function Emit-Attribute {
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
}
|
||||
|
||||
# Реквизит адресации задачи: AddressingDimension (ссылка на измерение регистра исполнителей), между Indexing и FullTextSearch.
|
||||
if ($context -eq "task-addressing" -and $elemTag -eq "AddressingAttribute") {
|
||||
if ($parsed.addressingDimension) { X "$indent`t`t<AddressingDimension>$(Esc-Xml "$($parsed.addressingDimension)")</AddressingDimension>" } else { X "$indent`t`t<AddressingDimension/>" }
|
||||
}
|
||||
$fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" }
|
||||
X "$indent`t`t<FullTextSearch>$fts</FullTextSearch>"
|
||||
}
|
||||
@@ -3150,86 +3155,81 @@ function Emit-BusinessProcessProperties {
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
X "$i<Comment/>"
|
||||
X "$i<UseStandardCommands>true</UseStandardCommands>"
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
X "$i<UseStandardCommands>$useStdCmd</UseStandardCommands>"
|
||||
X "$i<EditType>$(Get-EnumProp 'EditType' 'editType' 'InDialog')</EditType>"
|
||||
|
||||
$editType = Get-EnumProp "EditType" "editType" "InDialog"
|
||||
X "$i<EditType>$editType</EditType>"
|
||||
if (Test-DefKey 'inputByString') { $ibFields = @($def.inputByString | ForEach-Object { Expand-DataPath "$_" }) }
|
||||
else { $ibFields = @("BusinessProcess.$objName.StandardAttribute.Number") }
|
||||
Emit-FieldBlock $i "InputByString" $ibFields
|
||||
X "$i<CreateOnInput>$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'DontUse')</CreateOnInput>"
|
||||
X "$i<SearchStringModeOnInputByString>$(Get-EnumProp 'SearchStringModeOnInputByString' 'searchStringModeOnInputByString' 'Begin')</SearchStringModeOnInputByString>"
|
||||
X "$i<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>"
|
||||
X "$i<FullTextSearchOnInputByString>$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')</FullTextSearchOnInputByString>"
|
||||
Emit-FormRef $i "DefaultObjectForm" $def.defaultObjectForm
|
||||
Emit-FormRef $i "DefaultListForm" $def.defaultListForm
|
||||
Emit-FormRef $i "DefaultChoiceForm" $def.defaultChoiceForm
|
||||
Emit-FormRef $i "AuxiliaryObjectForm" $def.auxiliaryObjectForm
|
||||
Emit-FormRef $i "AuxiliaryListForm" $def.auxiliaryListForm
|
||||
Emit-FormRef $i "AuxiliaryChoiceForm" $def.auxiliaryChoiceForm
|
||||
X "$i<ChoiceHistoryOnInput>$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')</ChoiceHistoryOnInput>"
|
||||
|
||||
$numberType = Get-EnumProp "NumberType" "numberType" "String"
|
||||
$numberLength = if ($null -ne $def.numberLength) { "$($def.numberLength)" } else { "11" }
|
||||
$numberAllowedLength = Get-EnumProp "NumberAllowedLength" "numberAllowedLength" "Variable"
|
||||
$checkUnique = if ($def.checkUnique -eq $false) { "false" } else { "true" }
|
||||
$autonumbering = if ($def.autonumbering -eq $false) { "false" } else { "true" }
|
||||
|
||||
X "$i<NumberType>$numberType</NumberType>"
|
||||
X "$i<NumberLength>$numberLength</NumberLength>"
|
||||
X "$i<NumberAllowedLength>$numberAllowedLength</NumberAllowedLength>"
|
||||
X "$i<CheckUnique>$checkUnique</CheckUnique>"
|
||||
X "$i<Autonumbering>$autonumbering</Autonumbering>"
|
||||
|
||||
Emit-StandardAttributes $i "BusinessProcess"
|
||||
X "$i<Characteristics/>"
|
||||
Emit-Characteristics $i $def.characteristics
|
||||
|
||||
$task = if ($def.task) { "$($def.task)" } else { "" }
|
||||
if ($task) {
|
||||
X "$i<Task>$task</Task>"
|
||||
} else {
|
||||
X "$i<Task/>"
|
||||
}
|
||||
$autonumbering = if ($def.autonumbering -eq $false) { "false" } else { "true" }
|
||||
X "$i<Autonumbering>$autonumbering</Autonumbering>"
|
||||
Emit-BasedOn $i $def.basedOn
|
||||
X "$i<NumberPeriodicity>$(Get-EnumProp 'NumberPeriodicity' 'numberPeriodicity' 'Nonperiodical')</NumberPeriodicity>"
|
||||
|
||||
X "$i<BasedOn/>"
|
||||
X "$i<InputByString>"
|
||||
X "$i`t<xr:Field>BusinessProcess.$objName.StandardAttribute.Number</xr:Field>"
|
||||
X "$i</InputByString>"
|
||||
X "$i<CreateOnInput>DontUse</CreateOnInput>"
|
||||
X "$i<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>"
|
||||
X "$i<FullTextSearchOnInputByString>$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')</FullTextSearchOnInputByString>"
|
||||
X "$i<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>"
|
||||
X "$i<DefaultObjectForm/>"
|
||||
X "$i<DefaultListForm/>"
|
||||
X "$i<DefaultChoiceForm/>"
|
||||
X "$i<AuxiliaryObjectForm/>"
|
||||
X "$i<AuxiliaryListForm/>"
|
||||
X "$i<AuxiliaryChoiceForm/>"
|
||||
X "$i<IncludeHelpInContents>false</IncludeHelpInContents>"
|
||||
X "$i<DataLockFields/>"
|
||||
if ($def.task) { X "$i<Task>$(Esc-Xml "$($def.task)")</Task>" } else { X "$i<Task/>" }
|
||||
$createTaskPriv = if (Get-BoolProp "createTaskInPrivilegedMode" $true) { "true" } else { "false" }
|
||||
X "$i<CreateTaskInPrivilegedMode>$createTaskPriv</CreateTaskInPrivilegedMode>"
|
||||
|
||||
$dataLockControlMode = Get-EnumProp "DataLockControlMode" "dataLockControlMode" "Automatic"
|
||||
X "$i<DataLockControlMode>$dataLockControlMode</DataLockControlMode>"
|
||||
|
||||
$fullTextSearch = Get-EnumProp "FullTextSearch" "fullTextSearch" "Use"
|
||||
X "$i<FullTextSearch>$fullTextSearch</FullTextSearch>"
|
||||
$dlFields = if (Test-DefKey 'dataLockFields') { @($def.dataLockFields | ForEach-Object { Expand-DataPath "$_" }) } else { @() }
|
||||
Emit-FieldBlock $i "DataLockFields" $dlFields
|
||||
X "$i<DataLockControlMode>$(Get-EnumProp 'DataLockControlMode' 'dataLockControlMode' 'Managed')</DataLockControlMode>"
|
||||
$inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" }
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
X "$i<FullTextSearch>$(Get-EnumProp 'FullTextSearch' 'fullTextSearch' 'Use')</FullTextSearch>"
|
||||
|
||||
Emit-MLText $i "ObjectPresentation" $def.objectPresentation
|
||||
Emit-MLText $i "ExtendedObjectPresentation" $def.extendedObjectPresentation
|
||||
Emit-MLText $i "ListPresentation" $def.listPresentation
|
||||
Emit-MLText $i "ExtendedListPresentation" $def.extendedListPresentation
|
||||
Emit-MLText $i "Explanation" $def.explanation
|
||||
X "$i<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
X "$i<DataHistory>DontUse</DataHistory>"
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
X "$i<DataHistory>$(Get-EnumProp 'DataHistory' 'dataHistory' 'DontUse')</DataHistory>"
|
||||
$updDH = if (Get-BoolProp "updateDataHistoryImmediatelyAfterWrite" $false) { "true" } else { "false" }
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>$updDH</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
$execDH = if (Get-BoolProp "executeAfterWriteDataHistoryVersionProcessing" $false) { "true" } else { "false" }
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>$execDH</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
}
|
||||
|
||||
function Emit-TaskProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
X "$i<Comment/>"
|
||||
X "$i<UseStandardCommands>true</UseStandardCommands>"
|
||||
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
X "$i<UseStandardCommands>$useStdCmd</UseStandardCommands>"
|
||||
$numberType = Get-EnumProp "NumberType" "numberType" "String"
|
||||
$numberLength = if ($null -ne $def.numberLength) { "$($def.numberLength)" } else { "14" }
|
||||
$numberAllowedLength = Get-EnumProp "NumberAllowedLength" "numberAllowedLength" "Variable"
|
||||
$checkUnique = if ($def.checkUnique -eq $false) { "false" } else { "true" }
|
||||
$autonumbering = if ($def.autonumbering -eq $false) { "false" } else { "true" }
|
||||
|
||||
$taskNumberAutoPrefix = if ($def.taskNumberAutoPrefix) { "$($def.taskNumberAutoPrefix)" } else { "BusinessProcessNumber" }
|
||||
$descriptionLength = if ($null -ne $def.descriptionLength) { "$($def.descriptionLength)" } else { "150" }
|
||||
|
||||
X "$i<NumberType>$numberType</NumberType>"
|
||||
X "$i<NumberLength>$numberLength</NumberLength>"
|
||||
X "$i<NumberAllowedLength>$numberAllowedLength</NumberAllowedLength>"
|
||||
@@ -3237,52 +3237,44 @@ function Emit-TaskProperties {
|
||||
X "$i<Autonumbering>$autonumbering</Autonumbering>"
|
||||
X "$i<TaskNumberAutoPrefix>$taskNumberAutoPrefix</TaskNumberAutoPrefix>"
|
||||
X "$i<DescriptionLength>$descriptionLength</DescriptionLength>"
|
||||
|
||||
# Addressing
|
||||
$addressing = if ($def.addressing) { "$($def.addressing)" } else { "" }
|
||||
if ($addressing) { X "$i<Addressing>$addressing</Addressing>" } else { X "$i<Addressing/>" }
|
||||
|
||||
$mainAddressing = if ($def.mainAddressingAttribute) { "$($def.mainAddressingAttribute)" } else { "" }
|
||||
if ($mainAddressing) { X "$i<MainAddressingAttribute>$mainAddressing</MainAddressingAttribute>" } else { X "$i<MainAddressingAttribute/>" }
|
||||
|
||||
$currentPerformer = if ($def.currentPerformer) { "$($def.currentPerformer)" } else { "" }
|
||||
if ($currentPerformer) { X "$i<CurrentPerformer>$currentPerformer</CurrentPerformer>" } else { X "$i<CurrentPerformer/>" }
|
||||
|
||||
if ($def.addressing) { X "$i<Addressing>$(Esc-Xml "$($def.addressing)")</Addressing>" } else { X "$i<Addressing/>" }
|
||||
if ($def.mainAddressingAttribute) { X "$i<MainAddressingAttribute>$(Esc-Xml "$($def.mainAddressingAttribute)")</MainAddressingAttribute>" } else { X "$i<MainAddressingAttribute/>" }
|
||||
if ($def.currentPerformer) { X "$i<CurrentPerformer>$(Esc-Xml "$($def.currentPerformer)")</CurrentPerformer>" } else { X "$i<CurrentPerformer/>" }
|
||||
Emit-BasedOn $i $def.basedOn
|
||||
Emit-StandardAttributes $i "Task"
|
||||
X "$i<Characteristics/>"
|
||||
|
||||
X "$i<BasedOn/>"
|
||||
X "$i<InputByString>"
|
||||
X "$i`t<xr:Field>Task.$objName.StandardAttribute.Number</xr:Field>"
|
||||
X "$i</InputByString>"
|
||||
X "$i<CreateOnInput>DontUse</CreateOnInput>"
|
||||
X "$i<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>"
|
||||
Emit-Characteristics $i $def.characteristics
|
||||
X "$i<DefaultPresentation>$(Get-EnumProp 'DefaultPresentation' 'defaultPresentation' 'AsDescription')</DefaultPresentation>"
|
||||
X "$i<EditType>$(Get-EnumProp 'EditType' 'editType' 'InDialog')</EditType>"
|
||||
if (Test-DefKey 'inputByString') { $ibFields = @($def.inputByString | ForEach-Object { Expand-DataPath "$_" }) }
|
||||
else { $ibFields = @("Task.$objName.StandardAttribute.Number") }
|
||||
Emit-FieldBlock $i "InputByString" $ibFields
|
||||
X "$i<SearchStringModeOnInputByString>$(Get-EnumProp 'SearchStringModeOnInputByString' 'searchStringModeOnInputByString' 'Begin')</SearchStringModeOnInputByString>"
|
||||
X "$i<FullTextSearchOnInputByString>$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')</FullTextSearchOnInputByString>"
|
||||
X "$i<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>"
|
||||
X "$i<DefaultObjectForm/>"
|
||||
X "$i<DefaultListForm/>"
|
||||
X "$i<DefaultChoiceForm/>"
|
||||
X "$i<AuxiliaryObjectForm/>"
|
||||
X "$i<AuxiliaryListForm/>"
|
||||
X "$i<AuxiliaryChoiceForm/>"
|
||||
X "$i<IncludeHelpInContents>false</IncludeHelpInContents>"
|
||||
X "$i<DataLockFields/>"
|
||||
|
||||
$dataLockControlMode = Get-EnumProp "DataLockControlMode" "dataLockControlMode" "Automatic"
|
||||
X "$i<DataLockControlMode>$dataLockControlMode</DataLockControlMode>"
|
||||
|
||||
$fullTextSearch = Get-EnumProp "FullTextSearch" "fullTextSearch" "Use"
|
||||
X "$i<FullTextSearch>$fullTextSearch</FullTextSearch>"
|
||||
|
||||
X "$i<CreateOnInput>$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'DontUse')</CreateOnInput>"
|
||||
Emit-FormRef $i "DefaultObjectForm" $def.defaultObjectForm
|
||||
Emit-FormRef $i "DefaultListForm" $def.defaultListForm
|
||||
Emit-FormRef $i "DefaultChoiceForm" $def.defaultChoiceForm
|
||||
Emit-FormRef $i "AuxiliaryObjectForm" $def.auxiliaryObjectForm
|
||||
Emit-FormRef $i "AuxiliaryListForm" $def.auxiliaryListForm
|
||||
Emit-FormRef $i "AuxiliaryChoiceForm" $def.auxiliaryChoiceForm
|
||||
X "$i<ChoiceHistoryOnInput>$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')</ChoiceHistoryOnInput>"
|
||||
$inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" }
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
$dlFields = if (Test-DefKey 'dataLockFields') { @($def.dataLockFields | ForEach-Object { Expand-DataPath "$_" }) } else { @() }
|
||||
Emit-FieldBlock $i "DataLockFields" $dlFields
|
||||
X "$i<DataLockControlMode>$(Get-EnumProp 'DataLockControlMode' 'dataLockControlMode' 'Managed')</DataLockControlMode>"
|
||||
X "$i<FullTextSearch>$(Get-EnumProp 'FullTextSearch' 'fullTextSearch' 'Use')</FullTextSearch>"
|
||||
Emit-MLText $i "ObjectPresentation" $def.objectPresentation
|
||||
Emit-MLText $i "ExtendedObjectPresentation" $def.extendedObjectPresentation
|
||||
Emit-MLText $i "ListPresentation" $def.listPresentation
|
||||
Emit-MLText $i "ExtendedListPresentation" $def.extendedListPresentation
|
||||
Emit-MLText $i "Explanation" $def.explanation
|
||||
X "$i<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
X "$i<DataHistory>DontUse</DataHistory>"
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
X "$i<DataHistory>$(Get-EnumProp 'DataHistory' 'dataHistory' 'DontUse')</DataHistory>"
|
||||
$updDH = if (Get-BoolProp "updateDataHistoryImmediatelyAfterWrite" $false) { "true" } else { "false" }
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>$updDH</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
$execDH = if (Get-BoolProp "executeAfterWriteDataHistoryVersionProcessing" $false) { "true" } else { "false" }
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>$execDH</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
}
|
||||
|
||||
# --- 13f. Wave 6: HTTPService, WebService ---
|
||||
@@ -3491,48 +3483,9 @@ function Emit-Operation {
|
||||
|
||||
function Emit-AddressingAttribute {
|
||||
param([string]$indent, $addrDef)
|
||||
$uuid = New-Guid-String
|
||||
|
||||
$name = ""
|
||||
$attrSynonym = ""
|
||||
$typeStr = ""
|
||||
$addressingDimension = ""
|
||||
$indexing = "Index"
|
||||
|
||||
# Реквизит адресации = полный object-слой реквизита (контекст task-addressing) + AddressingDimension.
|
||||
$parsed = Parse-AttributeShorthand $addrDef
|
||||
$name = $parsed.name
|
||||
$attrSynonym = $parsed.synonym
|
||||
$typeStr = $parsed.type
|
||||
if ($addrDef -isnot [string]) {
|
||||
if ($addrDef.addressingDimension) { $addressingDimension = "$($addrDef.addressingDimension)" }
|
||||
if ($addrDef.indexing) { $indexing = "$($addrDef.indexing)" }
|
||||
}
|
||||
|
||||
X "$indent<AddressingAttribute uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $attrSynonym
|
||||
X "$indent`t`t<Comment/>"
|
||||
|
||||
if ($typeStr) {
|
||||
Emit-ValueType "$indent`t`t" $typeStr
|
||||
} else {
|
||||
X "$indent`t`t<Type>"
|
||||
X "$indent`t`t`t<v8:Type>xs:string</v8:Type>"
|
||||
X "$indent`t`t</Type>"
|
||||
}
|
||||
|
||||
if ($addressingDimension) {
|
||||
X "$indent`t`t<AddressingDimension>$addressingDimension</AddressingDimension>"
|
||||
} else {
|
||||
X "$indent`t`t<AddressingDimension/>"
|
||||
}
|
||||
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
X "$indent`t`t<FullTextSearch>Use</FullTextSearch>"
|
||||
X "$indent`t`t<DataHistory>Use</DataHistory>"
|
||||
X "$indent`t</Properties>"
|
||||
X "$indent</AddressingAttribute>"
|
||||
Emit-Attribute $indent $parsed "task-addressing" "AddressingAttribute"
|
||||
}
|
||||
|
||||
# --- 14. Namespaces ---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# meta-compile v1.47 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.48 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -613,7 +613,7 @@ def emit_type_content(indent, type_str):
|
||||
return
|
||||
|
||||
# Reference types — use local xmlns declaration for 1C compatibility
|
||||
m = re.match(r'^(CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|ExchangePlanRef|BusinessProcessRef|TaskRef)\.(.+)$', type_str)
|
||||
m = re.match(r'^(CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|ExchangePlanRef|BusinessProcessRef|BusinessProcessRoutePointRef|TaskRef)\.(.+)$', type_str)
|
||||
if m:
|
||||
X(f'{indent}<v8:Type xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d5p1:{type_str}</v8:Type>')
|
||||
return
|
||||
@@ -875,6 +875,7 @@ def parse_attribute_shorthand(val):
|
||||
'balance': val.get('balance') is True,
|
||||
'accountingFlag': val.get('accountingFlag'),
|
||||
'extDimensionAccountingFlag': val.get('extDimensionAccountingFlag'),
|
||||
'addressingDimension': val.get('addressingDimension'),
|
||||
}
|
||||
|
||||
def parse_enum_value_shorthand(val):
|
||||
@@ -1773,6 +1774,12 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
if parsed.get('indexing'):
|
||||
indexing = parsed['indexing']
|
||||
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
|
||||
# Реквизит адресации задачи: AddressingDimension (между Indexing и FullTextSearch).
|
||||
if context == 'task-addressing' and elem_tag == 'AddressingAttribute':
|
||||
if parsed.get('addressingDimension'):
|
||||
X(f'{indent}\t\t<AddressingDimension>{esc_xml(str(parsed["addressingDimension"]))}</AddressingDimension>')
|
||||
else:
|
||||
X(f'{indent}\t\t<AddressingDimension/>')
|
||||
X(f'{indent}\t\t<FullTextSearch>{parsed.get("fullTextSearch") or "Use"}</FullTextSearch>')
|
||||
# Измерение регистра накопления: UseInTotals (после FullTextSearch, дефолт true).
|
||||
if elem_tag == 'Dimension' and context == 'register-accum':
|
||||
@@ -3021,63 +3028,70 @@ def emit_business_process_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>true</UseStandardCommands>')
|
||||
edit_type = get_enum_prop('EditType', 'editType', 'InDialog')
|
||||
X(f'{i}<EditType>{edit_type}</EditType>')
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
else:
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>{"true" if get_bool_prop("useStandardCommands", True) else "false"}</UseStandardCommands>')
|
||||
X(f'{i}<EditType>{get_enum_prop("EditType", "editType", "InDialog")}</EditType>')
|
||||
if 'inputByString' in defn:
|
||||
ib_fields = [expand_data_path(str(x)) for x in (defn.get('inputByString') or [])]
|
||||
else:
|
||||
ib_fields = [f'BusinessProcess.{obj_name}.StandardAttribute.Number']
|
||||
emit_field_block(i, 'InputByString', ib_fields)
|
||||
X(f'{i}<CreateOnInput>{get_enum_prop("CreateOnInput", "createOnInput", "DontUse")}</CreateOnInput>')
|
||||
X(f'{i}<SearchStringModeOnInputByString>{get_enum_prop("SearchStringModeOnInputByString", "searchStringModeOnInputByString", "Begin")}</SearchStringModeOnInputByString>')
|
||||
X(f'{i}<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>')
|
||||
X(f'{i}<FullTextSearchOnInputByString>{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}</FullTextSearchOnInputByString>')
|
||||
emit_form_ref(i, 'DefaultObjectForm', defn.get('defaultObjectForm'))
|
||||
emit_form_ref(i, 'DefaultListForm', defn.get('defaultListForm'))
|
||||
emit_form_ref(i, 'DefaultChoiceForm', defn.get('defaultChoiceForm'))
|
||||
emit_form_ref(i, 'AuxiliaryObjectForm', defn.get('auxiliaryObjectForm'))
|
||||
emit_form_ref(i, 'AuxiliaryListForm', defn.get('auxiliaryListForm'))
|
||||
emit_form_ref(i, 'AuxiliaryChoiceForm', defn.get('auxiliaryChoiceForm'))
|
||||
X(f'{i}<ChoiceHistoryOnInput>{get_enum_prop("ChoiceHistoryOnInput", "choiceHistoryOnInput", "Auto")}</ChoiceHistoryOnInput>')
|
||||
number_type = get_enum_prop('NumberType', 'numberType', 'String')
|
||||
number_length = str(defn['numberLength']) if defn.get('numberLength') is not None else '11'
|
||||
number_allowed_length = get_enum_prop('NumberAllowedLength', 'numberAllowedLength', 'Variable')
|
||||
check_unique = 'false' if defn.get('checkUnique') is False else 'true'
|
||||
autonumbering = 'false' if defn.get('autonumbering') is False else 'true'
|
||||
X(f'{i}<NumberType>{number_type}</NumberType>')
|
||||
X(f'{i}<NumberLength>{number_length}</NumberLength>')
|
||||
X(f'{i}<NumberAllowedLength>{number_allowed_length}</NumberAllowedLength>')
|
||||
X(f'{i}<CheckUnique>{check_unique}</CheckUnique>')
|
||||
X(f'{i}<Autonumbering>{autonumbering}</Autonumbering>')
|
||||
emit_standard_attributes(i, 'BusinessProcess')
|
||||
X(f'{i}<Characteristics/>')
|
||||
emit_characteristics(i, defn.get('characteristics'))
|
||||
X(f'{i}<Autonumbering>{"false" if defn.get("autonumbering") is False else "true"}</Autonumbering>')
|
||||
emit_based_on(i, defn.get('basedOn'))
|
||||
X(f'{i}<NumberPeriodicity>{get_enum_prop("NumberPeriodicity", "numberPeriodicity", "Nonperiodical")}</NumberPeriodicity>')
|
||||
task_ref = str(defn['task']) if defn.get('task') else ''
|
||||
if task_ref:
|
||||
X(f'{i}<Task>{task_ref}</Task>')
|
||||
X(f'{i}<Task>{esc_xml(task_ref)}</Task>')
|
||||
else:
|
||||
X(f'{i}<Task/>')
|
||||
X(f'{i}<BasedOn/>')
|
||||
X(f'{i}<InputByString>')
|
||||
X(f'{i}\t<xr:Field>BusinessProcess.{obj_name}.StandardAttribute.Number</xr:Field>')
|
||||
X(f'{i}</InputByString>')
|
||||
X(f'{i}<CreateOnInput>DontUse</CreateOnInput>')
|
||||
X(f'{i}<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>')
|
||||
X(f'{i}<FullTextSearchOnInputByString>{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}</FullTextSearchOnInputByString>')
|
||||
X(f'{i}<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>')
|
||||
X(f'{i}<DefaultObjectForm/>')
|
||||
X(f'{i}<DefaultListForm/>')
|
||||
X(f'{i}<DefaultChoiceForm/>')
|
||||
X(f'{i}<AuxiliaryObjectForm/>')
|
||||
X(f'{i}<AuxiliaryListForm/>')
|
||||
X(f'{i}<AuxiliaryChoiceForm/>')
|
||||
X(f'{i}<IncludeHelpInContents>false</IncludeHelpInContents>')
|
||||
X(f'{i}<DataLockFields/>')
|
||||
data_lock_control_mode = get_enum_prop('DataLockControlMode', 'dataLockControlMode', 'Automatic')
|
||||
X(f'{i}<DataLockControlMode>{data_lock_control_mode}</DataLockControlMode>')
|
||||
full_text_search = get_enum_prop('FullTextSearch', 'fullTextSearch', 'Use')
|
||||
X(f'{i}<FullTextSearch>{full_text_search}</FullTextSearch>')
|
||||
X(f'{i}<CreateTaskInPrivilegedMode>{"true" if get_bool_prop("createTaskInPrivilegedMode", True) else "false"}</CreateTaskInPrivilegedMode>')
|
||||
dl_fields = [expand_data_path(str(x)) for x in defn.get('dataLockFields', [])] if 'dataLockFields' in defn else []
|
||||
emit_field_block(i, 'DataLockFields', dl_fields)
|
||||
X(f'{i}<DataLockControlMode>{get_enum_prop("DataLockControlMode", "dataLockControlMode", "Managed")}</DataLockControlMode>')
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
X(f'{i}<FullTextSearch>{get_enum_prop("FullTextSearch", "fullTextSearch", "Use")}</FullTextSearch>')
|
||||
emit_mltext(i, 'ObjectPresentation', defn.get('objectPresentation'))
|
||||
emit_mltext(i, 'ExtendedObjectPresentation', defn.get('extendedObjectPresentation'))
|
||||
emit_mltext(i, 'ListPresentation', defn.get('listPresentation'))
|
||||
emit_mltext(i, 'ExtendedListPresentation', defn.get('extendedListPresentation'))
|
||||
emit_mltext(i, 'Explanation', defn.get('explanation'))
|
||||
X(f'{i}<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
X(f'{i}<DataHistory>DontUse</DataHistory>')
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
X(f'{i}<DataHistory>{get_enum_prop("DataHistory", "dataHistory", "DontUse")}</DataHistory>')
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>{"true" if get_bool_prop("updateDataHistoryImmediatelyAfterWrite", False) else "false"}</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>{"true" if get_bool_prop("executeAfterWriteDataHistoryVersionProcessing", False) else "false"}</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
|
||||
def emit_task_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>true</UseStandardCommands>')
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
else:
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>{"true" if get_bool_prop("useStandardCommands", True) else "false"}</UseStandardCommands>')
|
||||
number_type = get_enum_prop('NumberType', 'numberType', 'String')
|
||||
number_length = str(defn['numberLength']) if defn.get('numberLength') is not None else '14'
|
||||
number_allowed_length = get_enum_prop('NumberAllowedLength', 'numberAllowedLength', 'Variable')
|
||||
@@ -3092,52 +3106,43 @@ def emit_task_properties(indent):
|
||||
X(f'{i}<Autonumbering>{autonumbering}</Autonumbering>')
|
||||
X(f'{i}<TaskNumberAutoPrefix>{task_number_auto_prefix}</TaskNumberAutoPrefix>')
|
||||
X(f'{i}<DescriptionLength>{description_length}</DescriptionLength>')
|
||||
addressing = str(defn['addressing']) if defn.get('addressing') else ''
|
||||
if addressing:
|
||||
X(f'{i}<Addressing>{addressing}</Addressing>')
|
||||
else:
|
||||
X(f'{i}<Addressing/>')
|
||||
main_addressing = str(defn['mainAddressingAttribute']) if defn.get('mainAddressingAttribute') else ''
|
||||
if main_addressing:
|
||||
X(f'{i}<MainAddressingAttribute>{main_addressing}</MainAddressingAttribute>')
|
||||
else:
|
||||
X(f'{i}<MainAddressingAttribute/>')
|
||||
current_performer = str(defn['currentPerformer']) if defn.get('currentPerformer') else ''
|
||||
if current_performer:
|
||||
X(f'{i}<CurrentPerformer>{current_performer}</CurrentPerformer>')
|
||||
else:
|
||||
X(f'{i}<CurrentPerformer/>')
|
||||
X(f'{i}<Addressing>{esc_xml(str(defn["addressing"]))}</Addressing>' if defn.get('addressing') else f'{i}<Addressing/>')
|
||||
X(f'{i}<MainAddressingAttribute>{esc_xml(str(defn["mainAddressingAttribute"]))}</MainAddressingAttribute>' if defn.get('mainAddressingAttribute') else f'{i}<MainAddressingAttribute/>')
|
||||
X(f'{i}<CurrentPerformer>{esc_xml(str(defn["currentPerformer"]))}</CurrentPerformer>' if defn.get('currentPerformer') else f'{i}<CurrentPerformer/>')
|
||||
emit_based_on(i, defn.get('basedOn'))
|
||||
emit_standard_attributes(i, 'Task')
|
||||
X(f'{i}<Characteristics/>')
|
||||
X(f'{i}<BasedOn/>')
|
||||
X(f'{i}<InputByString>')
|
||||
X(f'{i}\t<xr:Field>Task.{obj_name}.StandardAttribute.Number</xr:Field>')
|
||||
X(f'{i}</InputByString>')
|
||||
X(f'{i}<CreateOnInput>DontUse</CreateOnInput>')
|
||||
X(f'{i}<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>')
|
||||
emit_characteristics(i, defn.get('characteristics'))
|
||||
X(f'{i}<DefaultPresentation>{get_enum_prop("DefaultPresentation", "defaultPresentation", "AsDescription")}</DefaultPresentation>')
|
||||
X(f'{i}<EditType>{get_enum_prop("EditType", "editType", "InDialog")}</EditType>')
|
||||
if 'inputByString' in defn:
|
||||
ib_fields = [expand_data_path(str(x)) for x in (defn.get('inputByString') or [])]
|
||||
else:
|
||||
ib_fields = [f'Task.{obj_name}.StandardAttribute.Number']
|
||||
emit_field_block(i, 'InputByString', ib_fields)
|
||||
X(f'{i}<SearchStringModeOnInputByString>{get_enum_prop("SearchStringModeOnInputByString", "searchStringModeOnInputByString", "Begin")}</SearchStringModeOnInputByString>')
|
||||
X(f'{i}<FullTextSearchOnInputByString>{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}</FullTextSearchOnInputByString>')
|
||||
X(f'{i}<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>')
|
||||
X(f'{i}<DefaultObjectForm/>')
|
||||
X(f'{i}<DefaultListForm/>')
|
||||
X(f'{i}<DefaultChoiceForm/>')
|
||||
X(f'{i}<AuxiliaryObjectForm/>')
|
||||
X(f'{i}<AuxiliaryListForm/>')
|
||||
X(f'{i}<AuxiliaryChoiceForm/>')
|
||||
X(f'{i}<IncludeHelpInContents>false</IncludeHelpInContents>')
|
||||
X(f'{i}<DataLockFields/>')
|
||||
data_lock_control_mode = get_enum_prop('DataLockControlMode', 'dataLockControlMode', 'Automatic')
|
||||
X(f'{i}<DataLockControlMode>{data_lock_control_mode}</DataLockControlMode>')
|
||||
full_text_search = get_enum_prop('FullTextSearch', 'fullTextSearch', 'Use')
|
||||
X(f'{i}<FullTextSearch>{full_text_search}</FullTextSearch>')
|
||||
X(f'{i}<CreateOnInput>{get_enum_prop("CreateOnInput", "createOnInput", "DontUse")}</CreateOnInput>')
|
||||
emit_form_ref(i, 'DefaultObjectForm', defn.get('defaultObjectForm'))
|
||||
emit_form_ref(i, 'DefaultListForm', defn.get('defaultListForm'))
|
||||
emit_form_ref(i, 'DefaultChoiceForm', defn.get('defaultChoiceForm'))
|
||||
emit_form_ref(i, 'AuxiliaryObjectForm', defn.get('auxiliaryObjectForm'))
|
||||
emit_form_ref(i, 'AuxiliaryListForm', defn.get('auxiliaryListForm'))
|
||||
emit_form_ref(i, 'AuxiliaryChoiceForm', defn.get('auxiliaryChoiceForm'))
|
||||
X(f'{i}<ChoiceHistoryOnInput>{get_enum_prop("ChoiceHistoryOnInput", "choiceHistoryOnInput", "Auto")}</ChoiceHistoryOnInput>')
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
dl_fields = [expand_data_path(str(x)) for x in defn.get('dataLockFields', [])] if 'dataLockFields' in defn else []
|
||||
emit_field_block(i, 'DataLockFields', dl_fields)
|
||||
X(f'{i}<DataLockControlMode>{get_enum_prop("DataLockControlMode", "dataLockControlMode", "Managed")}</DataLockControlMode>')
|
||||
X(f'{i}<FullTextSearch>{get_enum_prop("FullTextSearch", "fullTextSearch", "Use")}</FullTextSearch>')
|
||||
emit_mltext(i, 'ObjectPresentation', defn.get('objectPresentation'))
|
||||
emit_mltext(i, 'ExtendedObjectPresentation', defn.get('extendedObjectPresentation'))
|
||||
emit_mltext(i, 'ListPresentation', defn.get('listPresentation'))
|
||||
emit_mltext(i, 'ExtendedListPresentation', defn.get('extendedListPresentation'))
|
||||
emit_mltext(i, 'Explanation', defn.get('explanation'))
|
||||
X(f'{i}<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
X(f'{i}<DataHistory>DontUse</DataHistory>')
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
X(f'{i}<DataHistory>{get_enum_prop("DataHistory", "dataHistory", "DontUse")}</DataHistory>')
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>{"true" if get_bool_prop("updateDataHistoryImmediatelyAfterWrite", False) else "false"}</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>{"true" if get_bool_prop("executeAfterWriteDataHistoryVersionProcessing", False) else "false"}</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
|
||||
def emit_http_service_properties(indent):
|
||||
i = indent
|
||||
@@ -3304,41 +3309,9 @@ def emit_operation(indent, op_name, op_def):
|
||||
X(f'{indent}</Operation>')
|
||||
|
||||
def emit_addressing_attribute(indent, addr_def):
|
||||
uid = new_uuid()
|
||||
name = ''
|
||||
attr_synonym = ''
|
||||
type_str = ''
|
||||
addressing_dimension = ''
|
||||
indexing = 'Index'
|
||||
# Реквизит адресации = полный object-слой реквизита (контекст task-addressing) + AddressingDimension.
|
||||
parsed = parse_attribute_shorthand(addr_def)
|
||||
name = parsed['name']
|
||||
attr_synonym = parsed['synonym']
|
||||
type_str = parsed['type']
|
||||
if not isinstance(addr_def, str):
|
||||
if addr_def.get('addressingDimension'):
|
||||
addressing_dimension = str(addr_def['addressingDimension'])
|
||||
if addr_def.get('indexing'):
|
||||
indexing = str(addr_def['indexing'])
|
||||
X(f'{indent}<AddressingAttribute uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', attr_synonym)
|
||||
X(f'{indent}\t\t<Comment/>')
|
||||
if type_str:
|
||||
emit_value_type(f'{indent}\t\t', type_str)
|
||||
else:
|
||||
X(f'{indent}\t\t<Type>')
|
||||
X(f'{indent}\t\t\t<v8:Type>xs:string</v8:Type>')
|
||||
X(f'{indent}\t\t</Type>')
|
||||
if addressing_dimension:
|
||||
X(f'{indent}\t\t<AddressingDimension>{addressing_dimension}</AddressingDimension>')
|
||||
else:
|
||||
X(f'{indent}\t\t<AddressingDimension/>')
|
||||
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
|
||||
X(f'{indent}\t\t<FullTextSearch>Use</FullTextSearch>')
|
||||
X(f'{indent}\t\t<DataHistory>Use</DataHistory>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</AddressingAttribute>')
|
||||
emit_attribute(indent, parsed, 'task-addressing', 'AddressingAttribute')
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 14. Namespaces
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# meta-decompile v0.39 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# meta-decompile v0.40 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
#
|
||||
# Поддержаны: Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, Document. Инверс meta-compile (omit-on-default: ключ эмитим только
|
||||
@@ -91,8 +91,8 @@ foreach ($c in $rootEl.ChildNodes) { if ($c.NodeType -eq 'Element') { $objNode =
|
||||
if (-not $objNode) { [Console]::Error.WriteLine("meta-decompile: пустой MetaDataObject"); exit 3 }
|
||||
$objType = $objNode.LocalName
|
||||
|
||||
if ($objType -notin @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts', 'ChartOfCalculationTypes', 'Document', 'InformationRegister', 'AccumulationRegister', 'AccountingRegister', 'CalculationRegister')) {
|
||||
[Console]::Error.WriteLine("meta-decompile: тип '$objType' пока не поддержан (Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, Document, InformationRegister, AccumulationRegister, AccountingRegister, CalculationRegister)"); exit 3
|
||||
if ($objType -notin @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts', 'ChartOfCalculationTypes', 'Document', 'InformationRegister', 'AccumulationRegister', 'AccountingRegister', 'CalculationRegister', 'BusinessProcess', 'Task')) {
|
||||
[Console]::Error.WriteLine("meta-decompile: тип '$objType' пока не поддержан (Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, Document, InformationRegister, AccumulationRegister, AccountingRegister, CalculationRegister, BusinessProcess, Task)"); exit 3
|
||||
}
|
||||
|
||||
$props = $objNode.SelectSingleNode('md:Properties', $nsm)
|
||||
@@ -303,6 +303,7 @@ function Attr-ToDsl {
|
||||
$v = & $en 'Balance'; if ($v -eq 'true') { $extra['balance'] = $true }
|
||||
$v = & $en 'AccountingFlag'; if ($v) { $extra['accountingFlag'] = $v } # ссылка на признак учёта ПС (пустой → пропуск)
|
||||
$v = & $en 'ExtDimensionAccountingFlag'; if ($v) { $extra['extDimensionAccountingFlag'] = $v }
|
||||
$v = & $en 'AddressingDimension'; if ($v) { $extra['addressingDimension'] = $v } # ссылка на измерение регистра исполнителей
|
||||
# MinValue/MaxValue — граница диапазона (omit при nil). Тип сохраняем: xs:string→строка, xs:decimal→число.
|
||||
foreach ($mm in @('MinValue','MaxValue')) {
|
||||
$mn = $ap.SelectSingleNode("md:$mm", $nsm)
|
||||
@@ -544,6 +545,32 @@ if ($objType -eq 'CalculationRegister') {
|
||||
$schv = P 'ScheduleValue'; if ($schv) { $dsl['scheduleValue'] = $schv }
|
||||
$schd = P 'ScheduleDate'; if ($schd) { $dsl['scheduleDate'] = $schd }
|
||||
}
|
||||
# BusinessProcess-специфичные свойства: нумерация (Document-стиль), связь с задачей, привилегированный режим.
|
||||
if ($objType -eq 'BusinessProcess') {
|
||||
Add-EnumProp 'numberType' 'NumberType' 'String'
|
||||
Add-IntProp 'numberLength' 'NumberLength' 11
|
||||
Add-EnumProp 'numberAllowedLength' 'NumberAllowedLength' 'Variable'
|
||||
Add-EnumProp 'numberPeriodicity' 'NumberPeriodicity' 'Nonperiodical'
|
||||
# CheckUnique/Autonumbering дефолт true (совпадает с компилятором → захват только при false).
|
||||
Add-BoolProp 'checkUnique' 'CheckUnique' $true
|
||||
Add-BoolProp 'autonumbering' 'Autonumbering' $true
|
||||
$tsk = P 'Task'; if ($tsk) { $dsl['task'] = $tsk }
|
||||
Add-BoolProp 'createTaskInPrivilegedMode' 'CreateTaskInPrivilegedMode' $true
|
||||
}
|
||||
# Task-специфичные свойства: нумерация, адресация, текущий исполнитель.
|
||||
if ($objType -eq 'Task') {
|
||||
Add-EnumProp 'numberType' 'NumberType' 'String'
|
||||
Add-IntProp 'numberLength' 'NumberLength' 14
|
||||
Add-EnumProp 'numberAllowedLength' 'NumberAllowedLength' 'Variable'
|
||||
Add-BoolProp 'checkUnique' 'CheckUnique' $true
|
||||
Add-BoolProp 'autonumbering' 'Autonumbering' $true
|
||||
$tnap = P 'TaskNumberAutoPrefix'; if ($tnap -and $tnap -ne 'BusinessProcessNumber') { $dsl['taskNumberAutoPrefix'] = $tnap }
|
||||
Add-IntProp 'descriptionLength' 'DescriptionLength' 150
|
||||
$addr = P 'Addressing'; if ($addr) { $dsl['addressing'] = $addr }
|
||||
$maa = P 'MainAddressingAttribute'; if ($maa) { $dsl['mainAddressingAttribute'] = $maa }
|
||||
$cp = P 'CurrentPerformer'; if ($cp) { $dsl['currentPerformer'] = $cp }
|
||||
Add-EnumProp 'defaultPresentation' 'DefaultPresentation' 'AsDescription'
|
||||
}
|
||||
|
||||
# Короткая форма поля: <Type>.<Name>.StandardAttribute.X / .Attribute.X → StandardAttribute.X / Attribute.X
|
||||
# (Expand-DataPath компилятора разворачивает частичную форму обратно — dogfood резолвера).
|
||||
@@ -742,8 +769,8 @@ if ($saNode) {
|
||||
}
|
||||
# Условный тип (Catalog): пустой $saMap = триггер блока. Не-условный (ExchangePlan): блок и так эмитится → пустой не пишем.
|
||||
if ($saMap.Count -gt 0 -or ($stdConditionalTypes -contains $objType)) { $dsl['standardAttributes'] = $saMap }
|
||||
} elseif ($objType -in @('InformationRegister', 'AccumulationRegister', 'AccountingRegister', 'CalculationRegister')) {
|
||||
# Регистр опускает all-default блок стандартных реквизитов (~5-9%, правило не выводимо) — компилятор эмитит его
|
||||
} elseif ($objType -in @('InformationRegister', 'AccumulationRegister', 'AccountingRegister', 'CalculationRegister', 'BusinessProcess', 'Task')) {
|
||||
# Регистр/БП/Задача опускают all-default блок стандартных реквизитов (правило не выводимо) — компилятор эмитит его
|
||||
# по дефолту, поэтому отсутствие фиксируем opt-out `standardAttributes:""` (дом-конвенция суппресса).
|
||||
$dsl['standardAttributes'] = ''
|
||||
}
|
||||
@@ -784,6 +811,13 @@ if ($childObjs) {
|
||||
foreach ($a in $resNodes) { [void]$arr.Add((Attr-ToDsl $a)) }
|
||||
$dsl['resources'] = $arr
|
||||
}
|
||||
# Задача: реквизиты адресации (AddressingAttribute) — структурно как реквизит + AddressingDimension.
|
||||
$addrNodes = @($childObjs.SelectNodes('md:AddressingAttribute', $nsm))
|
||||
if ($addrNodes.Count -gt 0) {
|
||||
$arr = [System.Collections.ArrayList]@()
|
||||
foreach ($a in $addrNodes) { [void]$arr.Add((Attr-ToDsl $a)) }
|
||||
$dsl['addressingAttributes'] = $arr
|
||||
}
|
||||
$tsNodes = @($childObjs.SelectNodes('md:TabularSection', $nsm))
|
||||
if ($tsNodes.Count -gt 0) {
|
||||
$tsMap = [ordered]@{}
|
||||
|
||||
@@ -885,6 +885,22 @@ ExtDimension1..N связаны с Account через `linkByType` (в блок
|
||||
Измерения РР несут `denyIncompleteValues`, `baseDimension` (bool), `scheduleLink` (ссылка на измерение графика);
|
||||
реквизиты — `scheduleLink`; ресурсы — только `<FullTextSearch>` (без Indexing).
|
||||
|
||||
### 7.6c BusinessProcess (Бизнес-процесс)
|
||||
|
||||
Ссылочный тип с нумерацией (Document-стиль). Поля: `numberType`/`numberLength`/`numberAllowedLength`/`checkUnique`/
|
||||
`autonumbering`/`numberPeriodicity` (нумерация); `task` (ссылка `Task.X`); `createTaskInPrivilegedMode` (bool, дефолт
|
||||
true); `characteristics` (§7.1.4); `basedOn`/`inputByString`/`dataLockFields` (§7.1.5); `editType`/`createOnInput`/формы/
|
||||
презентации; `dataLockControlMode` (дефолт **Managed**); DataHistory-триплет; `attributes`/`tabularSections`/`commands`.
|
||||
Тип точки маршрута — `BusinessProcessRoutePointRef.X` (ссылка на маршрут самого БП).
|
||||
|
||||
### 7.6d Task (Задача)
|
||||
|
||||
Ссылочный тип адресных задач. Поля: нумерация (как БП) + `taskNumberAutoPrefix`/`descriptionLength`; `addressing`
|
||||
(ссылка на регистр сведений исполнителей); `mainAddressingAttribute`/`currentPerformer` (ссылки); `defaultPresentation`;
|
||||
`basedOn`/`characteristics`/`inputByString`/`dataLockFields`; формы/презентации; `dataLockControlMode` (дефолт **Managed**).
|
||||
Дети: `attributes`, `commands` и **`addressingAttributes`** — реквизиты адресации (полный object-слой реквизита +
|
||||
`addressingDimension`: ссылка на измерение регистра исполнителей).
|
||||
|
||||
### 7.7 DefinedType
|
||||
|
||||
| Поле JSON | Умолчание | XML элемент |
|
||||
|
||||
+20
-18
@@ -38,11 +38,24 @@
|
||||
<Comment/>
|
||||
<UseStandardCommands>true</UseStandardCommands>
|
||||
<EditType>InDialog</EditType>
|
||||
<InputByString>
|
||||
<xr:Field>BusinessProcess.СогласованиеДокумента.StandardAttribute.Number</xr:Field>
|
||||
</InputByString>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
|
||||
<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
|
||||
<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
|
||||
<DefaultObjectForm/>
|
||||
<DefaultListForm/>
|
||||
<DefaultChoiceForm/>
|
||||
<AuxiliaryObjectForm/>
|
||||
<AuxiliaryListForm/>
|
||||
<AuxiliaryChoiceForm/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<NumberType>String</NumberType>
|
||||
<NumberLength>11</NumberLength>
|
||||
<NumberAllowedLength>Variable</NumberAllowedLength>
|
||||
<CheckUnique>true</CheckUnique>
|
||||
<Autonumbering>true</Autonumbering>
|
||||
<StandardAttributes>
|
||||
<xr:StandardAttribute name="Ref">
|
||||
<xr:LinkByType/>
|
||||
@@ -228,31 +241,20 @@
|
||||
</xr:StandardAttribute>
|
||||
</StandardAttributes>
|
||||
<Characteristics/>
|
||||
<Task>Task.ЗадачаИсполнителя</Task>
|
||||
<Autonumbering>true</Autonumbering>
|
||||
<BasedOn/>
|
||||
<InputByString>
|
||||
<xr:Field>BusinessProcess.СогласованиеДокумента.StandardAttribute.Number</xr:Field>
|
||||
</InputByString>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
|
||||
<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
|
||||
<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
|
||||
<DefaultObjectForm/>
|
||||
<DefaultListForm/>
|
||||
<DefaultChoiceForm/>
|
||||
<AuxiliaryObjectForm/>
|
||||
<AuxiliaryListForm/>
|
||||
<AuxiliaryChoiceForm/>
|
||||
<IncludeHelpInContents>false</IncludeHelpInContents>
|
||||
<NumberPeriodicity>Nonperiodical</NumberPeriodicity>
|
||||
<Task>Task.ЗадачаИсполнителя</Task>
|
||||
<CreateTaskInPrivilegedMode>true</CreateTaskInPrivilegedMode>
|
||||
<DataLockFields/>
|
||||
<DataLockControlMode>Automatic</DataLockControlMode>
|
||||
<DataLockControlMode>Managed</DataLockControlMode>
|
||||
<IncludeHelpInContents>false</IncludeHelpInContents>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<ObjectPresentation/>
|
||||
<ExtendedObjectPresentation/>
|
||||
<ListPresentation/>
|
||||
<ExtendedListPresentation/>
|
||||
<Explanation/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DataHistory>DontUse</DataHistory>
|
||||
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
|
||||
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<Addressing/>
|
||||
<MainAddressingAttribute/>
|
||||
<CurrentPerformer/>
|
||||
<BasedOn/>
|
||||
<StandardAttributes>
|
||||
<xr:StandardAttribute name="Ref">
|
||||
<xr:LinkByType/>
|
||||
@@ -254,30 +255,31 @@
|
||||
</xr:StandardAttribute>
|
||||
</StandardAttributes>
|
||||
<Characteristics/>
|
||||
<BasedOn/>
|
||||
<DefaultPresentation>AsDescription</DefaultPresentation>
|
||||
<EditType>InDialog</EditType>
|
||||
<InputByString>
|
||||
<xr:Field>Task.ЗадачаИсполнителя.StandardAttribute.Number</xr:Field>
|
||||
</InputByString>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
|
||||
<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
|
||||
<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<DefaultObjectForm/>
|
||||
<DefaultListForm/>
|
||||
<DefaultChoiceForm/>
|
||||
<AuxiliaryObjectForm/>
|
||||
<AuxiliaryListForm/>
|
||||
<AuxiliaryChoiceForm/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<IncludeHelpInContents>false</IncludeHelpInContents>
|
||||
<DataLockFields/>
|
||||
<DataLockControlMode>Automatic</DataLockControlMode>
|
||||
<DataLockControlMode>Managed</DataLockControlMode>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<ObjectPresentation/>
|
||||
<ExtendedObjectPresentation/>
|
||||
<ListPresentation/>
|
||||
<ExtendedListPresentation/>
|
||||
<Explanation/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DataHistory>DontUse</DataHistory>
|
||||
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
|
||||
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
|
||||
@@ -339,8 +341,29 @@
|
||||
<Type>
|
||||
<v8:Type xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d5p1:CatalogRef.Пользователи</v8:Type>
|
||||
</Type>
|
||||
<PasswordMode>false</PasswordMode>
|
||||
<Format/>
|
||||
<EditFormat/>
|
||||
<ToolTip/>
|
||||
<MarkNegatives>false</MarkNegatives>
|
||||
<Mask/>
|
||||
<MultiLine>false</MultiLine>
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillFromFillingValue>false</FillFromFillingValue>
|
||||
<FillValue xsi:nil="true"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<Indexing>DontIndex</Indexing>
|
||||
<AddressingDimension/>
|
||||
<Indexing>Index</Indexing>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<DataHistory>Use</DataHistory>
|
||||
</Properties>
|
||||
@@ -358,8 +381,29 @@
|
||||
<Type>
|
||||
<v8:Type xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d5p1:CatalogRef.РолиИсполнителей</v8:Type>
|
||||
</Type>
|
||||
<PasswordMode>false</PasswordMode>
|
||||
<Format/>
|
||||
<EditFormat/>
|
||||
<ToolTip/>
|
||||
<MarkNegatives>false</MarkNegatives>
|
||||
<Mask/>
|
||||
<MultiLine>false</MultiLine>
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillFromFillingValue>false</FillFromFillingValue>
|
||||
<FillValue xsi:nil="true"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<Indexing>DontIndex</Indexing>
|
||||
<AddressingDimension/>
|
||||
<Indexing>Index</Indexing>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<DataHistory>Use</DataHistory>
|
||||
</Properties>
|
||||
|
||||
Reference in New Issue
Block a user