Skip to content

Calculation logic for values in 'automatic fields' in schemas #2986

@anvabr

Description

@anvabr

Problem description

There are frequent cases when the value in a field in the document that is described by a schema (and displayed as a form to the user) is automatically calculated based on values in other fields. Currently policies use custom logic block for such cases. This approach was adopted when such cases were seen a exceptional, since then the team has learned that these are more common than not. This approach is unnecessarily complex and hard to maintain, and thus a better method should be found.

Requirements

  • Introduce facilities into schema definition language which would allow for the referencing of other fields/values and specification of mathematics needed to calculate the field value based on those.
  • It should be possible to reference fields from 'other' schemas in the chain - parents/children.

Definition of done

  • Auto-calculated values in the fields are specified in schemas
  • The usage of the new technique is demonstrated in the example policies
  • Documentation is updated accordingly

Acceptance criteria

  • Schemas are self-contained - data and basic logic of the data (derived data) are defined in the schema documents
  • This new method is easier to use and maintain

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Epic.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions