I have a modelling problem that I can’t figure out how to solve in the Kernel Language. The problem sounds simple, but I run into a cyclic dependency when I try to solve it.
I have a Repeatable Group with Fields VALUE, NAME and EXCLUDE. VALUE is an enum with the values “unused”, “v1”, “v2” and “v3”. NAME and EXCLUDE are text fields. I want a Rule that sets VALUE to “unsused” whenever VALUE of another group instance is set to something other than “unused” and EXCLUDE of the other group instance equals NAME of this group instance. So basically, each group instance can “deactivate” another group instance, when it has a value other than “unused” set.
The problem is that I can’t have a computation for a field with its field path used in the computation. Otherwise I could just set VALUE to “unused”directly when the condition is met. As a workaround I tried to compute a confirm helper field like this:
Precondition: AtLeastOneFieldValueIncludedInValueList(MyGroup*/VALUE Having [EXCLUDE] == [$NAME] And
CurrentRepetition(RuleGroup) != CurrentRepetition($RuleGroup)
In “v1”, “v2”, “v3”)
Calculation: True
But I can’t do much with this helper field, since setting VALUE as a dependent field on it also leads to a cyclic dependency. Another workaround I tried is adding a new Field VALUE_INPUT and use this field in the computation above. Then if the condition becomes true, I set VALUE_INPUT to not relevant/read only and VALUE to “unused”. Otherwise I set VALUE to the value of VALUE_INPUT.
This seems to work at first, but runs into problems when I have chains of exclusions. If I have the Group Instances A, B and C, where A excludes B and B excludes C and all values are set to “unused”. Then I set B to “v1” which excludes C. Then I set A to “v1”. This leads to B being excluded but C also being excluded, as I did not change VALUE_INPUT of B, but only VALUE.
Do you have an idea how I can solve my problem?




