Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Policy definition language to include a Formula calculations block #4535

Open
anvabr opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@anvabr
Copy link
Collaborator

anvabr commented Jan 9, 2025

Problem description

Currently Policy authors need to use programming concepts/language within CustomLogic block or simplistic arithmetical definitions in CalculateMathAddon blocks to implement formulas which are usually specified in the official methodology documents using standard math notation. #3408 enabled policy authors to link these existing implementations of formulas logically and visually to such mathematical formula definitions. In some cases, however, at least where the 'official' formulas are of limited complexity, it should be possible to enable policy authors to input them directly into the policy definition, and for Guardian to directly execute them at Policy run time.

Requirements

Introduce a Formula calculation block which would:

  • Allow Policy authors to input mathematical formulas directly into the policy (using Gurdian UI formula editor) in the standard mathematical notation (https://cortexjs.io/mathlive/editor/)
  • Enable policy authors to bind variables/parameters in these formulas to data (fields in schemas) for inputs/outputs to integrate the block into the Policy workflow
  • At Policy run time perform the calculations directly without any additional input etc from users (https://arthanzel.github.io/evaluatex/)

Extend Guardian UI to:

  • Whenever the result of such calculation is shown to the user to also display the formula definition in the standard math notation
  • Also display the values of the variables/parameters in the formula which were used to calculate these results
  • Enable users to navigate to the data sources of these values (used for the calculations) by providing links to the required levels depth

Definition of done

  • Functionality is implemented as specified above
  • New capabilities are documented
  • A practical example of FormulaCalculation block is available in at least one of the policies published in Guardian repository

Acceptance criteria

Policy authors can use FormulaCalculation block (whenever the complexity of the math permits) instead of CustomLogic and/or CalculateMathAddon block. The specified formulas are evaluated by Guardian policy engine directly without additional user involvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant