Computation based on another computation field (value missing)

Hi all, I’m facing a strange behavior.
I have 2 Computed Field. The 1. should be computed once and persisted (And never computed again because the conditions are changed right afterwards), the 2. uses the value from 1. Field.
What I’m witnessing is that even my Document has a value for Field 1, On computation of Field 2 the computation of Field 1 is requested again - At that point the value of Field 1 is null, because the condition for Field 1 is no longer fullfilled by design.
Is this expected behaviour or am I missing something ? I would like to read the value which is present in the document

Hi @kostadin-cold-rain,

As a modeler, you cannot specify which Computation Rules are evaluated. All Computation Rules will be evaluated. In fact, the Kernel will work out that you need to recompute the value of the first Field to be able to calculate the second Field correctly.

This ensures that your data matches the business logic in your Model.

There isn’t a modeling workaround to “turn off” a Computation Rule.

Just to highlight what your options are, now that we know that the behavior that you’ve observed is expected:

  1. Model a Custom Field or Custom Condition and ask a developer to create the code so that the 1. Field is only computed once.
  2. There is a horrible modeling workaround that I would not recommend. If you have found a modeling workaround that you think works, I’d encourage you to ask yourself whether this works equally in the frontend and backend of your application? Does this hack really meet your requirements?

If you need support with Custom Fields or Conditions, please feel free to ask.