diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index 417e7cb9..8b96df18 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -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 "$indentd5p1:$typeStr" 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" } + # Реквизит адресации задачи: AddressingDimension (ссылка на измерение регистра исполнителей), между Indexing и FullTextSearch. + if ($context -eq "task-addressing" -and $elemTag -eq "AddressingAttribute") { + if ($parsed.addressingDimension) { X "$indent`t`t$(Esc-Xml "$($parsed.addressingDimension)")" } else { X "$indent`t`t" } + } $fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" } X "$indent`t`t$fts" } @@ -3150,86 +3155,81 @@ function Emit-BusinessProcessProperties { X "$i$(Esc-Xml $objName)" Emit-MLText $i "Synonym" $synonym - X "$i" - X "$itrue" + if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } + $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } + X "$i$useStdCmd" + X "$i$(Get-EnumProp 'EditType' 'editType' 'InDialog')" - $editType = Get-EnumProp "EditType" "editType" "InDialog" - X "$i$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$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'DontUse')" + X "$i$(Get-EnumProp 'SearchStringModeOnInputByString' 'searchStringModeOnInputByString' 'Begin')" + X "$iDirectly" + X "$i$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')" + 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$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')" $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" X "$i$numberLength" X "$i$numberAllowedLength" X "$i$checkUnique" - X "$i$autonumbering" Emit-StandardAttributes $i "BusinessProcess" - X "$i" + Emit-Characteristics $i $def.characteristics - $task = if ($def.task) { "$($def.task)" } else { "" } - if ($task) { - X "$i$task" - } else { - X "$i" - } + $autonumbering = if ($def.autonumbering -eq $false) { "false" } else { "true" } + X "$i$autonumbering" + Emit-BasedOn $i $def.basedOn + X "$i$(Get-EnumProp 'NumberPeriodicity' 'numberPeriodicity' 'Nonperiodical')" - X "$i" - X "$i" - X "$i`tBusinessProcess.$objName.StandardAttribute.Number" - X "$i" - X "$iDontUse" - X "$iBegin" - X "$i$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')" - X "$iDirectly" - X "$i" - X "$i" - X "$i" - X "$i" - X "$i" - X "$i" - X "$ifalse" - X "$i" + if ($def.task) { X "$i$(Esc-Xml "$($def.task)")" } else { X "$i" } + $createTaskPriv = if (Get-BoolProp "createTaskInPrivilegedMode" $true) { "true" } else { "false" } + X "$i$createTaskPriv" - $dataLockControlMode = Get-EnumProp "DataLockControlMode" "dataLockControlMode" "Automatic" - X "$i$dataLockControlMode" - - $fullTextSearch = Get-EnumProp "FullTextSearch" "fullTextSearch" "Use" - X "$i$fullTextSearch" + $dlFields = if (Test-DefKey 'dataLockFields') { @($def.dataLockFields | ForEach-Object { Expand-DataPath "$_" }) } else { @() } + Emit-FieldBlock $i "DataLockFields" $dlFields + X "$i$(Get-EnumProp 'DataLockControlMode' 'dataLockControlMode' 'Managed')" + $inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" } + X "$i$inclHelp" + X "$i$(Get-EnumProp 'FullTextSearch' 'fullTextSearch' 'Use')" 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 "$iAuto" - X "$iDontUse" - X "$ifalse" - X "$ifalse" + X "$i$(Get-EnumProp 'DataHistory' 'dataHistory' 'DontUse')" + $updDH = if (Get-BoolProp "updateDataHistoryImmediatelyAfterWrite" $false) { "true" } else { "false" } + X "$i$updDH" + $execDH = if (Get-BoolProp "executeAfterWriteDataHistoryVersionProcessing" $false) { "true" } else { "false" } + X "$i$execDH" } function Emit-TaskProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" Emit-MLText $i "Synonym" $synonym - X "$i" - X "$itrue" - + if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } + $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } + X "$i$useStdCmd" $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" X "$i$numberLength" X "$i$numberAllowedLength" @@ -3237,52 +3237,44 @@ function Emit-TaskProperties { X "$i$autonumbering" X "$i$taskNumberAutoPrefix" X "$i$descriptionLength" - - # Addressing - $addressing = if ($def.addressing) { "$($def.addressing)" } else { "" } - if ($addressing) { X "$i$addressing" } else { X "$i" } - - $mainAddressing = if ($def.mainAddressingAttribute) { "$($def.mainAddressingAttribute)" } else { "" } - if ($mainAddressing) { X "$i$mainAddressing" } else { X "$i" } - - $currentPerformer = if ($def.currentPerformer) { "$($def.currentPerformer)" } else { "" } - if ($currentPerformer) { X "$i$currentPerformer" } else { X "$i" } - + if ($def.addressing) { X "$i$(Esc-Xml "$($def.addressing)")" } else { X "$i" } + if ($def.mainAddressingAttribute) { X "$i$(Esc-Xml "$($def.mainAddressingAttribute)")" } else { X "$i" } + if ($def.currentPerformer) { X "$i$(Esc-Xml "$($def.currentPerformer)")" } else { X "$i" } + Emit-BasedOn $i $def.basedOn Emit-StandardAttributes $i "Task" - X "$i" - - X "$i" - X "$i" - X "$i`tTask.$objName.StandardAttribute.Number" - X "$i" - X "$iDontUse" - X "$iBegin" + Emit-Characteristics $i $def.characteristics + X "$i$(Get-EnumProp 'DefaultPresentation' 'defaultPresentation' 'AsDescription')" + X "$i$(Get-EnumProp 'EditType' 'editType' 'InDialog')" + if (Test-DefKey 'inputByString') { $ibFields = @($def.inputByString | ForEach-Object { Expand-DataPath "$_" }) } + else { $ibFields = @("Task.$objName.StandardAttribute.Number") } + Emit-FieldBlock $i "InputByString" $ibFields + X "$i$(Get-EnumProp 'SearchStringModeOnInputByString' 'searchStringModeOnInputByString' 'Begin')" X "$i$(Get-EnumProp 'FullTextSearchOnInputByString' 'fullTextSearchOnInputByString' 'DontUse')" X "$iDirectly" - X "$i" - X "$i" - X "$i" - X "$i" - X "$i" - X "$i" - X "$ifalse" - X "$i" - - $dataLockControlMode = Get-EnumProp "DataLockControlMode" "dataLockControlMode" "Automatic" - X "$i$dataLockControlMode" - - $fullTextSearch = Get-EnumProp "FullTextSearch" "fullTextSearch" "Use" - X "$i$fullTextSearch" - + X "$i$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'DontUse')" + 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$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')" + $inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" } + X "$i$inclHelp" + $dlFields = if (Test-DefKey 'dataLockFields') { @($def.dataLockFields | ForEach-Object { Expand-DataPath "$_" }) } else { @() } + Emit-FieldBlock $i "DataLockFields" $dlFields + X "$i$(Get-EnumProp 'DataLockControlMode' 'dataLockControlMode' 'Managed')" + X "$i$(Get-EnumProp 'FullTextSearch' 'fullTextSearch' 'Use')" 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 "$iAuto" - X "$iDontUse" - X "$ifalse" - X "$ifalse" + X "$i$(Get-EnumProp 'DataHistory' 'dataHistory' 'DontUse')" + $updDH = if (Get-BoolProp "updateDataHistoryImmediatelyAfterWrite" $false) { "true" } else { "false" } + X "$i$updDH" + $execDH = if (Get-BoolProp "executeAfterWriteDataHistoryVersionProcessing" $false) { "true" } else { "false" } + X "$i$execDH" } # --- 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" - X "$indent`t" - X "$indent`t`t$(Esc-Xml $name)" - Emit-MLText "$indent`t`t" "Synonym" $attrSynonym - X "$indent`t`t" - - if ($typeStr) { - Emit-ValueType "$indent`t`t" $typeStr - } else { - X "$indent`t`t" - X "$indent`t`t`txs:string" - X "$indent`t`t" - } - - if ($addressingDimension) { - X "$indent`t`t$addressingDimension" - } else { - X "$indent`t`t" - } - - X "$indent`t`t$indexing" - X "$indent`t`tUse" - X "$indent`t`tUse" - X "$indent`t" - X "$indent" + Emit-Attribute $indent $parsed "task-addressing" "AddressingAttribute" } # --- 14. Namespaces --- diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index 91de027e..277297ef 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -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}d5p1:{type_str}') 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}') + # Реквизит адресации задачи: AddressingDimension (между Indexing и FullTextSearch). + if context == 'task-addressing' and elem_tag == 'AddressingAttribute': + if parsed.get('addressingDimension'): + X(f'{indent}\t\t{esc_xml(str(parsed["addressingDimension"]))}') + else: + X(f'{indent}\t\t') X(f'{indent}\t\t{parsed.get("fullTextSearch") or "Use"}') # Измерение регистра накопления: 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}{esc_xml(obj_name)}') emit_mltext(i, 'Synonym', synonym) - X(f'{i}') - X(f'{i}true') - edit_type = get_enum_prop('EditType', 'editType', 'InDialog') - X(f'{i}{edit_type}') + if defn.get('comment'): + X(f'{i}{esc_xml_text(str(defn["comment"]))}') + else: + X(f'{i}') + X(f'{i}{"true" if get_bool_prop("useStandardCommands", True) else "false"}') + X(f'{i}{get_enum_prop("EditType", "editType", "InDialog")}') + 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}{get_enum_prop("CreateOnInput", "createOnInput", "DontUse")}') + X(f'{i}{get_enum_prop("SearchStringModeOnInputByString", "searchStringModeOnInputByString", "Begin")}') + X(f'{i}Directly') + X(f'{i}{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}') + 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}{get_enum_prop("ChoiceHistoryOnInput", "choiceHistoryOnInput", "Auto")}') 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}{number_type}') X(f'{i}{number_length}') X(f'{i}{number_allowed_length}') X(f'{i}{check_unique}') - X(f'{i}{autonumbering}') emit_standard_attributes(i, 'BusinessProcess') - X(f'{i}') + emit_characteristics(i, defn.get('characteristics')) + X(f'{i}{"false" if defn.get("autonumbering") is False else "true"}') + emit_based_on(i, defn.get('basedOn')) + X(f'{i}{get_enum_prop("NumberPeriodicity", "numberPeriodicity", "Nonperiodical")}') task_ref = str(defn['task']) if defn.get('task') else '' if task_ref: - X(f'{i}{task_ref}') + X(f'{i}{esc_xml(task_ref)}') else: X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}\tBusinessProcess.{obj_name}.StandardAttribute.Number') - X(f'{i}') - X(f'{i}DontUse') - X(f'{i}Begin') - X(f'{i}{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}') - X(f'{i}Directly') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}false') - X(f'{i}') - data_lock_control_mode = get_enum_prop('DataLockControlMode', 'dataLockControlMode', 'Automatic') - X(f'{i}{data_lock_control_mode}') - full_text_search = get_enum_prop('FullTextSearch', 'fullTextSearch', 'Use') - X(f'{i}{full_text_search}') + X(f'{i}{"true" if get_bool_prop("createTaskInPrivilegedMode", True) else "false"}') + 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}{get_enum_prop("DataLockControlMode", "dataLockControlMode", "Managed")}') + X(f'{i}{"true" if get_bool_prop("includeHelpInContents", False) else "false"}') + X(f'{i}{get_enum_prop("FullTextSearch", "fullTextSearch", "Use")}') 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}Auto') - X(f'{i}DontUse') - X(f'{i}false') - X(f'{i}false') + X(f'{i}{get_enum_prop("DataHistory", "dataHistory", "DontUse")}') + X(f'{i}{"true" if get_bool_prop("updateDataHistoryImmediatelyAfterWrite", False) else "false"}') + X(f'{i}{"true" if get_bool_prop("executeAfterWriteDataHistoryVersionProcessing", False) else "false"}') def emit_task_properties(indent): i = indent X(f'{i}{esc_xml(obj_name)}') emit_mltext(i, 'Synonym', synonym) - X(f'{i}') - X(f'{i}true') + if defn.get('comment'): + X(f'{i}{esc_xml_text(str(defn["comment"]))}') + else: + X(f'{i}') + X(f'{i}{"true" if get_bool_prop("useStandardCommands", True) else "false"}') 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}') X(f'{i}{task_number_auto_prefix}') X(f'{i}{description_length}') - addressing = str(defn['addressing']) if defn.get('addressing') else '' - if addressing: - X(f'{i}{addressing}') - else: - X(f'{i}') - main_addressing = str(defn['mainAddressingAttribute']) if defn.get('mainAddressingAttribute') else '' - if main_addressing: - X(f'{i}{main_addressing}') - else: - X(f'{i}') - current_performer = str(defn['currentPerformer']) if defn.get('currentPerformer') else '' - if current_performer: - X(f'{i}{current_performer}') - else: - X(f'{i}') + X(f'{i}{esc_xml(str(defn["addressing"]))}' if defn.get('addressing') else f'{i}') + X(f'{i}{esc_xml(str(defn["mainAddressingAttribute"]))}' if defn.get('mainAddressingAttribute') else f'{i}') + X(f'{i}{esc_xml(str(defn["currentPerformer"]))}' if defn.get('currentPerformer') else f'{i}') + emit_based_on(i, defn.get('basedOn')) emit_standard_attributes(i, 'Task') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}\tTask.{obj_name}.StandardAttribute.Number') - X(f'{i}') - X(f'{i}DontUse') - X(f'{i}Begin') + emit_characteristics(i, defn.get('characteristics')) + X(f'{i}{get_enum_prop("DefaultPresentation", "defaultPresentation", "AsDescription")}') + X(f'{i}{get_enum_prop("EditType", "editType", "InDialog")}') + 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}{get_enum_prop("SearchStringModeOnInputByString", "searchStringModeOnInputByString", "Begin")}') X(f'{i}{get_enum_prop("FullTextSearchOnInputByString", "fullTextSearchOnInputByString", "DontUse")}') X(f'{i}Directly') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}') - X(f'{i}false') - X(f'{i}') - data_lock_control_mode = get_enum_prop('DataLockControlMode', 'dataLockControlMode', 'Automatic') - X(f'{i}{data_lock_control_mode}') - full_text_search = get_enum_prop('FullTextSearch', 'fullTextSearch', 'Use') - X(f'{i}{full_text_search}') + X(f'{i}{get_enum_prop("CreateOnInput", "createOnInput", "DontUse")}') + 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}{get_enum_prop("ChoiceHistoryOnInput", "choiceHistoryOnInput", "Auto")}') + X(f'{i}{"true" if get_bool_prop("includeHelpInContents", False) else "false"}') + 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}{get_enum_prop("DataLockControlMode", "dataLockControlMode", "Managed")}') + X(f'{i}{get_enum_prop("FullTextSearch", "fullTextSearch", "Use")}') 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}Auto') - X(f'{i}DontUse') - X(f'{i}false') - X(f'{i}false') + X(f'{i}{get_enum_prop("DataHistory", "dataHistory", "DontUse")}') + X(f'{i}{"true" if get_bool_prop("updateDataHistoryImmediatelyAfterWrite", False) else "false"}') + X(f'{i}{"true" if get_bool_prop("executeAfterWriteDataHistoryVersionProcessing", False) else "false"}') def emit_http_service_properties(indent): i = indent @@ -3304,41 +3309,9 @@ def emit_operation(indent, op_name, op_def): X(f'{indent}') 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}') - X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(name)}') - emit_mltext(f'{indent}\t\t', 'Synonym', attr_synonym) - X(f'{indent}\t\t') - if type_str: - emit_value_type(f'{indent}\t\t', type_str) - else: - X(f'{indent}\t\t') - X(f'{indent}\t\t\txs:string') - X(f'{indent}\t\t') - if addressing_dimension: - X(f'{indent}\t\t{addressing_dimension}') - else: - X(f'{indent}\t\t') - X(f'{indent}\t\t{indexing}') - X(f'{indent}\t\tUse') - X(f'{indent}\t\tUse') - X(f'{indent}\t') - X(f'{indent}') + emit_attribute(indent, parsed, 'task-addressing', 'AddressingAttribute') # --------------------------------------------------------------------------- # 14. Namespaces diff --git a/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 b/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 index 11c9d69f..58c8bf8e 100644 --- a/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 +++ b/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 @@ -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' +} # Короткая форма поля: ..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]@{} diff --git a/docs/meta-dsl-spec.md b/docs/meta-dsl-spec.md index 0c454755..91b97713 100644 --- a/docs/meta-dsl-spec.md +++ b/docs/meta-dsl-spec.md @@ -885,6 +885,22 @@ ExtDimension1..N связаны с Account через `linkByType` (в блок Измерения РР несут `denyIncompleteValues`, `baseDimension` (bool), `scheduleLink` (ссылка на измерение графика); реквизиты — `scheduleLink`; ресурсы — только `` (без 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 элемент | diff --git a/tests/skills/cases/meta-compile/snapshots/business-process/BusinessProcesses/СогласованиеДокумента.xml b/tests/skills/cases/meta-compile/snapshots/business-process/BusinessProcesses/СогласованиеДокумента.xml index 0ad36b79..1419fffa 100644 --- a/tests/skills/cases/meta-compile/snapshots/business-process/BusinessProcesses/СогласованиеДокумента.xml +++ b/tests/skills/cases/meta-compile/snapshots/business-process/BusinessProcesses/СогласованиеДокумента.xml @@ -38,11 +38,24 @@ true InDialog + + BusinessProcess.СогласованиеДокумента.StandardAttribute.Number + + DontUse + Begin + Directly + DontUse + + + + + + + Auto String 11 Variable true - true @@ -228,31 +241,20 @@ - Task.ЗадачаИсполнителя + true - - BusinessProcess.СогласованиеДокумента.StandardAttribute.Number - - DontUse - Begin - DontUse - Directly - - - - - - - false + Nonperiodical + Task.ЗадачаИсполнителя + true - Automatic + Managed + false Use - Auto DontUse false false diff --git a/tests/skills/cases/meta-compile/snapshots/task/Tasks/ЗадачаИсполнителя.xml b/tests/skills/cases/meta-compile/snapshots/task/Tasks/ЗадачаИсполнителя.xml index 75575d0f..92318185 100644 --- a/tests/skills/cases/meta-compile/snapshots/task/Tasks/ЗадачаИсполнителя.xml +++ b/tests/skills/cases/meta-compile/snapshots/task/Tasks/ЗадачаИсполнителя.xml @@ -43,6 +43,7 @@ + @@ -254,30 +255,31 @@ - + AsDescription + InDialog Task.ЗадачаИсполнителя.StandardAttribute.Number - DontUse Begin DontUse Directly + DontUse + Auto false - Automatic + Managed Use - Auto DontUse false false @@ -339,8 +341,29 @@ d5p1:CatalogRef.Пользователи + false + + + + false + + false + false + + + false + + DontCheck + Items + + + Auto + Auto + + + Auto + DontIndex - Index Use Use @@ -358,8 +381,29 @@ d5p1:CatalogRef.РолиИсполнителей + false + + + + false + + false + false + + + false + + DontCheck + Items + + + Auto + Auto + + + Auto + DontIndex - Index Use Use