ModelingValueGroup / dclareForMPS

Adding declarative, reactive and incremental rules to MPS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange "TooManyChanges" exception (in cdm)

tombrus opened this issue · comments

The following rule triggers it:

rule if (propertyValue != null) { 
  propertyValue.result := derivedValue; 
  propertyValue.causes := assignments.reasonRefs.distinct.copy; 
}

the following change solves it:

rule if (propertyValue != null) { 
  propertyValue.causes := assignments.reasonRefs.distinct.copy; 
} 
rule if (propertyValue != null) { 
  propertyValue.result := derivedValue; 
}

there seem to be other solutions like changing the order of the assignments, adding .toList after the copy or adding some tracing of assignments.reasonRefs.distinct.copy in a local variable.

We discovered this in a private repo (Osteoporose), see revision e39faec67a5558fd3076b66ed2a2aba8e4a8b10c.
The above change in cdm (also private) is in 59848d85f759daa0c83500b95bbf6ebcb51a5c1f.