Dataflow: Common Template patterns

Intent

Across Silverfin workflows, certain template types are used across business units and packages:

  • Settings
  • Checks and validations
  • Visualisation
  • Overview

These templates have specific data management and presentation needs. Understanding them helps developers choose an appropriate structure for their use case and implement these templates consistently across workflows.

Problem

Developers building Silverfin workflows can face recurring scenarios that require similar solutions:

  • Workflow settings need to be completed before work can continue.
  • Company and workflow data needs to be stored and accessed across multiple periods, templates, and workflows.
  • Validation logic and data visualisation must be organised in an efficient and clear way without creating performance issues or circular references.
  • Multi-period comparisons need a clear structure so that duplicated logic and performance issues are avoided.

Solution

In this document we describe commonly used template archetypes that address these needs.

Settings

  • Displaying company identification numbers, company form and other information that remains constant across all periods
  • Storing workflow-specific configuration such as
    • Tax regime
    • Meeting dates
    • Contact information of company representatives

Checks and validations

  • Legislative compliance validations
    • Completeness of information inside the workflow
    • Mandatory disclosure checks
    • Correctness of the information
      • x + y needs to be bigger than z
    • Cross-template validations

Visualisation

  • Tax return form that is ready for filing
  • Annual Accounts formatted for yearly submission
  • Financial statements that can be presented to the client.

Overview

  • Yearly comparisons
  • Comparison between raw and manipulated data

How to implement

Settings

  • Determine data scope for each field
    • Use the company drop for data that should be consistent across all periods and globally updated
    • Use period drop or template custom variables for data that can vary by period or should preserve historical values
  • Consider trade-offs
    • Information on the company drop can be convenient, but beware of updating locked periods
    • Information on the period drop can’t be rolled forward when working in a template

Checks and validations

Preferred approach through a shared part.

  • Create a shared part containing all checks and validations that exist in the workflow
  • Structure the shared part to return the result of the validation in a consistent format
  • Include the shared part from
    • The designated checks template in order to display all checks
    • The individual template so that relevant checks are displayed

Visualisation

  • Minimise logic
    • focus on displaying data instead of calculating
  • Fetch calculated results from other templates
  • Map out the dependency chain before implementation to avoid excessive depth.

Overview

  • Follow the same principles as the visualisation template
    • minimal logic
    • fetch results from other templates
  • Be careful with dependencies when pulling data from multiple periods

Pros and cons

Settings

  • Pro
    • Centralises information and setup of the workflow
    • Company level data is accessible everywhere and easy to update
    • Reduce duplication of commonly used data
  • Con
    • Company level data can impact locked periods and change historic information
    • Requires careful consideration of the dataflow
      • May create dependency issues later on

Checks and validations

  • Option 1: logic in individual template
    • Pro
      • Natural dataflow
      • Validation logic lives next to the related calculation
    • Con
      • Increased load time in checks template due to dependencies on all other template
  • Option 2: logic done in checks template
    • Pro
      • Centralised information
      • Better loading time for the checks template
    • Con
      • Circular references are easily introduced
      • Logic duplication which increases potential oversights and bugs
  • Option 3: add checks and validation logic to a shared part - preferred
    • Pro
      • Separate logic and view
      • No circular references
      • Performance
      • DRY
    • Con
      • Requires more planning upfront and setup time

Visualisation

  • Pro
    • Clear separation between data and presentation
    • Optimised from user-facing output
    • Consistent reporting structure
  • Con
    • Carefully manage dependency chain in order to avoid caching issues
    • Performance depends on the upstream results of other templates