Community
Participate
Working Groups
Created attachment 261849 [details] the metamodel The CreateInstance operation doesn't work on an unary composition that is already set. The error message is "Impossible to add a value to the reference <referenceName> of the object". It seems that Sirius tries to execute a "add" while it should execute a "set". I have reproduced this case on a simple metamodel (with A containing B) and VSM (a diagram for A which contains nodes for B). A tool performing a CreateInstance works the first time, then fails (when the relation is set).
Created attachment 261850 [details] a modeler reproducing the bug
Created attachment 261851 [details] a sample model
I tried to reproduce your problem, but the test metamodel is missing. Can you attach it?
Sorry, I don't see that the metamodel is directly attached within the description (and not within a new comment). So I'm able to reproduce the problem. In your case, what do you expect for the already existing B instance? It should be automatically delete by Sirius? I think that your tool must be completed to delete the already existing B before adding a new one.
Created attachment 262112 [details] The modified VSM with the proposed solution Are you OK with the solution?
After discussion, if you call programatically set() on this kind of reference, EMF replaces the existing B by the new one (the old one is "lost"). Sirius could do the same. Nevertheless, we have currently not planned to work on it in the following releases. The solution proposed in comment 5 can be used as workaround.