ObjCalculationEdit extends ObjCalculation to provide YAML export
functionality for calculation group configurations. It exports complete
group definitions including all steps, with SQL content formatted for
readability and descriptions reflowed.
Exported files are written to local.documents/calculations/ by default.
ObjCalculation.ObjCalculation
→ ObjCalculationEdit.ObjCalculationEdit ← this module
| Table | Purpose |
|---|---|
def_calculation |
Group metadata (presql, postsql, review notes) |
def_calculations |
Individual calculation steps ordered by rank |
The YAML output nests all steps under the group header. Package and
CalculationGroup keys are omitted from steps since they are implied
by the group context.
calculation_group: MY_GROUP
presql: |
SELECT ...
steps:
- calculation_name: STEP1
rank: 1
active: Y
calculation_sql: |
UPDATE target_table
SET field = value
WHERE Guid = '$guid$'
has_result: N
- calculation_name: STEP2
rank: 2
has_result: Y
calculation_sql: |
SELECT value FROM lookup_table WHERE ...
# Export a calculation group (output: local.documents/calculations/MY_GROUP.yaml)
python factory.core/extend.edit/ObjCalculationEdit.py MY_GROUP
# Custom output filename
python factory.core/extend.edit/ObjCalculationEdit.py MY_GROUP \
--filename backup.yaml
# Specific package
python factory.core/extend.edit/ObjCalculationEdit.py MY_GROUP \
--package homechoice
| Method | Purpose |
|---|---|
load(group_name, package) |
Load group header + steps from DB |
export_to_file(group_name, filename, package) |
Export to YAML file |