-
Notifications
You must be signed in to change notification settings - Fork 26
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
Desire for 'calculated' fields #1830
Comments
This is very interesting and is something that I would like to implement myself for a different reason (making requirements connect to each other's data using Python) but there was no good time spent on conceptualizing this. Before we discuss this non-trivial feature: previously, you asked about using the API here: #1378. To simplify your existing workflow, you could simply implement a Python script, learning from the existing commands of StrictDoc (see https://github.com/strictdoc-project/strictdoc/blob/main/strictdoc/commands/manage_autouid_command.py). You would give your script an SDoc file, a script would populate all dynamic fields based on the formula of your choice, and then it would give you an updated SDoc file back. Could this improve the situation a little? Regarding the calculated fields: I am imagining that the GRAMMAR/ELEMENT/FIELDS grammar could be extended with a field such as It would be great to make this feature's concept elegant/consistent. I am open to suggestions. |
Excellent!
Hmm yes, that is a good point. It would be a step towards a better solution. It's not ideal as it would require someone to run the script to update the scores (I wouldn't want our CI job to be modifying and committing to the repo automatically), but as long as a CI check detects invalid scores we will be safe. Also, updating them in this way makes it quick and easy to do.
I agree that this is a non-trivial feature and therefore requires some careful thought and design. I think that 'dynamic' is probably a better term for this feature. Things that I can think of off the top of my head that should be considered are:
|
We use strictdoc to manage our risk assessments. As part of the risk assessment process it is necessary to score each risk based on severity and likelihood. From those two numeric values a single 'risk score' is calculated. In our case the risk score is determined from a look-up table based on the severity and likelihood (so not a simple mathematical function). At the moment we have to manually update the risk score whenever the severity or likelihood is modified, which is a laborious and error-prone process. We could (and will) implement a CI check that the manually recorded risk-score is correct, but we would prefer it if we didn't have to perform any manual work at all.
I know that this is potentially quite a deviation from the current architecture of strictdoc, but we would find it incredibly helpful if there was the ability to have 'calculated' fields, whose value is determined by a small python function based on the value of other fields. Ideally the result of the calculation would be visible in all 'presentation' forms (live server, exported format, python API).
The text was updated successfully, but these errors were encountered: