Community
Participate
Working Groups
Created attachment 254458 [details] Example to reproduce. Using a Set model operation do a addAll() for multi-valued references instead of a set. Scenario to reproduce : 1. Using the attached project, open the "new DiagramForBug467663Bis" diagram 2. Reconnect target edge from c1 to c2 => the original edge is always here because the Set model operation has kept c1 in the Component.references list. The Sirius documentation doesn't specify this strange behaviour : "The expression’s result is then set as the new value" see https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#set
While I agree the current behavior is strange, it is not possible to change it: it would cause hard to understand breakage on existing modelers which rely on it (perhaps unknowingly). We could provide an alternate operation, or a boolean option to the existing one. Proposal: * add a boolean SetValue.clearPreviousValue, which would be false by default (thus not requiring any migration of existing VSMs); * in the UI, present it as a checkbox "Append to the existing values". It would be the inverse of the boolean, because I think it makes more sense at the UI level than the opposite wording. * in the code, if SetValue is executed on a multi-valued feature *and* if clearPreviousValue is true, do the equivalent of a object.eGet(featureName).clear() before the normal add (or be a little smarter to avoid sending too many notifications). In the meantime, this does not prevent improving the current documentation to make the current behavior explicit.