Logic of automatically refreshing stored calc value

#1

In below example, if I have data a which is A, data b which is B and data c which is C, and a, b, c are linked together.

When deleting data c, it will automatically refresh stored calc field groups on data a.

In this case, I would like to know: 1) if refreshing stored calc on data a will trigger updated callback on data a or not? 2) if yes, will updated callback be triggered after refreshing stored calc on a is completed? which is kind of refresh stored calc on a ---> updated callback on a

entity type A {
  mappings: [B] (parent)
  groups: [C] stored calc 'mappings.group'
}

entity type B {
  parent: A
  group: C
}

entity type C
0 Likes

#2

Actually, in the above example, deleting an instance of C will have no effect as the references to C will remain in B.group, thus not affecting the field A.groups. However, assuming that there was a real dependency, all downstream invalidation (whether stored calc or the created/udpated/removed callbacks) will be placed in the queue and finally committed after the transaction for the update operation is completed.

So, if something caused a stored calc field to be refreshed on A, the subsequent updated callback would be queued/processed after that stored calc refresh has occurred. Does this make sense?

0 Likes

#3

Yes, it makes sense.

Good to know that deleting an instance of C will have no effect as the references to C will remain in B.group

0 Likes