Referencing computed Field makes DM invalid

Hi Everybody,

I have a document model with several computed fields that works fine as long as I dont reference a certain field in any precondition or computation. As soon as I use this field in any computation I get build errors in our application and also the Ad hoc testing does not work anymore.

The field in question is “Stand”. I tried to validate the model with the SME and also to tried the Rule Contradictions function but none of those give me any error or reason what is wrong.
Without referencing “Stand” anywhere the model behaves like intended and the computation for “Stand” also work and I could not find any mistake in the computation for “Stand”. So I dont know what is wrong here.

Maybe anyone of you has an idea what the problem here is?

I attached the model with the problematic field. If you want to recreate the issue try Ad hoc testing of the whole model and you will get an error. To get rid of the error you have to remove any reference of the field “Stand” in the computation “comp_massgebliches_Kapital”. When the references to Stand are removed Ad hoc testing will work normally and also the field “Stand” is computed correctly.
KKE_de-gaap-ci_dm_Content.json (99.2 KB)


Thank you very much in advance for taking a look into the matter.
Best regards
Konstantin

Hi @konstantin-rugged-stone,

The issue appears to be that you have a chain of computations and the Stand Field is in the middle of this chain. By taking Stand out of the comp_massgeliches_Kapital you break the chain and everything works again.

Here are the Rules that build the look and the possible Computations.

comp_Ergebnis comp_Stand comp_massgebliches_Kapital
Sum( massgebliches_Kapital, Umschichtungen_Jahresergebnis, Umschichtungen,Kapitalveraenderungen, sonstige_Zufuehrungen ) - Sum( Ausschuettungen, Kapital) Sum( Wirtschaftsjahr*/Kapitalkonto*/Kapital Having ([Wirtschaftsjahr/Kapitalkonto/Kapitalkonto] == K15 OR [Wirtschaftsjahr/Kapitalkonto/Kapitalkonto] == K13) AND CurrentRepetition(Wirtschaftsjahr) == {CurrentRepetition($Wirtschaftsjahr)-1}) Sum( Vorjahr, Kapitalanpassungen )
Sum( Wirtschaftsjahr*/Kapitalkonto*/Ergebnis_lfd_Jahr Having [Wirtschaftsjahr/Kapitalkonto/Kapitalkonto] == K16) AND CurrentRepetition(Wirtschaftsjahr) == {CurrentRepetition($Wirtschaftsjahr)-1}) Sum( Stand, Kapitalanpassungen )
Sum( Wirtschaftsjahr*/Kapitalkonto*/Kapital Having ([Wirtschaftsjahr/Kapitalkonto/Kapitalkonto] == K16) AND CurrentRepetition(Wirtschaftsjahr) == {CurrentRepetition($Wirtschaftsjahr)-1} ) - Sum( Wirtschaftsjahr*/Kapitalkonto*/Ergebnis_lfd_Jahr Having ([Wirtschaftsjahr/Kapitalkonto/Kapitalkonto] == K16) AND CurrentRepetition(Wirtschaftsjahr) == {CurrentRepetition($Wirtschaftsjahr)-1})
MaxValue(Wirtschaftsjahr*/Kapitalkonto*/Kapital Having CurrentRepetition(Wirtschaftsjahr)=={CurrentRepetition($Wirtschaftsjahr)-1} AND [Wirtschaftsjahr/Kapitalkonto/Kapitalkonto]==[$Wirtschaftsjahr/Kapitalkonto/Kapitalkonto])

As you can see

  1. comp_Ergebnis uses massgebliches_Kapital to compute Ergebnis_lfd_Jahr
  2. comp_Stand then uses Ergebnis_lfd_Jahr in the 2nd and 3rd calculations to compute Stand
  3. comp_massgebliches_Kapital then uses Stand in the 2nd calculation to compute massgebliches_Kapital

and this builds your loop.

It’s hard to detect automatically because it is only there with certain combinations of preconditions. Although this is might be an “open” loop. This was specified in A12-13871 which came into effect in 2023.06 and was documented in the Form Engine Migration Instructions. As you can see from the Kernel Language Documentation the “open” loop in Example 8 is forbidden.

You need to analyse the computations and prevent this sort of loop from forming.

In case you’re interested, this is how I tested the model.

  1. Ad-hoc test the whole model as described by @konstantin-rugged-stone.
  2. Ad-hoc test the Computation Rule “comp_massgebliches_Kapital”. This worked and the Ad-hoc test started. I could enter Data and all was well.
  3. As “Stand” is also a computed Field, I performed an Ad-hoc test on the Computation Rule “comp_Stand”. This also worked.
  4. I used the Multi-Selection to Ad-hoc test “comp_massgebliches_Kapital” and “comp_Stand” together. This also worked.
  5. I then looked at the Fields referenced in “comp_Stand”, found two computed Fields and started adding their Computation Rules into the scope of my Ad-hoc test. This led to me finding the combination of Rules that caused the problem.

Dear @patrick-smooth-cache

was the response helpful and is the issue now solved or are there some additional questions? If it is solved, please, use the checkbox to mark the solution to your problem so that other users also know what helped to your case.

All the best
from the Discourse team

We had a discussion with the A12 Kernel team, currently there is no solution for the problem, and it would need a new requirement that Kernel would have to provide for us. The process is still in progress.

Hello @patrick-smooth-cache, I am a member of the Discourse team. Is the process still ongoing? Was a ticket created, if yes could you please provide us with the ticket number?

Thanks ahead for your feedback and have a nice rest of the day!