Calculations with new Workflows-Architecture

Hallo, after migrating to the new workflows architecture, i’ve encountered an issue where calculations are not being triggered when the screen is initially opened. The calculations only execute after specific fields in the form are manually modified by the user.

Steps to Reproduce:

  1. Open the screen that relies on the new workflow setup.
  2. Observe that no calculations are performed initially.
  3. Change a relevant field in the form.
  4. Calculations are triggered as expected.

Expected Behavior:
Calculations should be triggered automatically when the screen is loaded, without requiring any manual changes to the form fields.

Please advise on how i can ensure the calculations are triggered on screen load as intended.

Best regards,
Alexander

Hi @alexander-grey-cluster

Per-default, loading data into a Form does not trigger a re-calculation. This ensures the best possible performance. A modeling setting was added in 2024.06-ext4 so you can trigger a re-calculation when loading the data into a specific Form Model.

If you need a re-calculation before loading, updating the Document in the backend should trigger a re-calculation.

Thank you very much for the claryfication!

I think the catch here is the following:

  • we are setting a field in the workflow (via setdocumentfield-delegate)
  • there is a computation based on that field, the result is a transient field (as we only need it for showing/hiding UI-controls)
  • we were expecting that field to be computed when we open the task-form

Transient fields are not persisted, hence the expected field does not come from the server when loading the document. And as you clarified, (re-)computation of (externally modified) documents when opening a form is not standard behaviour.

So we will simply go ahead and make the field non-transient.