Community
Participate
Working Groups
Editor descriptions might depend on the Sirius metamodel. That can be specified which allows succesfull validation of these editor descriptions. However, opening an associated *.aird file leads to loading referenced models. The editor then starts to include also the Sirius meta models and all models they depend on. This leads to a large list of models. I noted this in particular when a model I was editing was referring to another model. Sometimes everything seemed fine until the moment I closed and restarted eclipse. Then, opening the *.aird files lead to loading models like Ecore.ecore.
See also: https://www.eclipse.org/forums/index.php/t/1027875/
Indeed it comes from RepresentationDescription.metamodel:EPackage[0..*] reference. We should find a better mean to reference metamodel without loading them.
I would say there might be two distincts problems here. The expression validation complaining about "not knowning about DSemanticDiagram" is a bug in itself (which I could not reproduce using master) Would that be possible for you to attach a Viewpoint Specification Project which reveal this issue ? Now regarding the referencing of the EPackages in the .odesign, we indeed have quite an "unclear" story and need to sort that out. Either we make sure to always reference the Ecore's through their nsURI and then setup the proper URIMappings, or always platform:/plugin... Right now it really depends on "how the user did load the Ecore model" which offers many choices, through the "load Resources.." or using one of the button from the property view. Each of these choice will have an implication and might lead to fragile relative references, or references which are not valid once the .odesign is deployed. EcorePlugin.computePlatformURIMap() have a role to play in the whole story and should probably be called by the SiriusEditor so that Ecore which are imported in the workspace are "shadowing" those deployed in the target platform.
Indeed when testing on master, adding Sirius metamodels in Metamodels tabs of properties view on RepresentationDescription selection seems not needed for validation when having Sirius EClass referenced in interpreted expression. For example having "[self.oclIsTypeOf(DSemanticDecorator)/]" in a precondition, the validation is ok. Wilbert, which release of Sirius do you use? And could you provide a minimal reproduction case? It is RepresentationDescriptionMetamodelsUpdater which manages these metamodels reference to have odesign references directly by URI instead of by nsURI. We could look at it to better manage that.
Created attachment 251355 [details] Description that meets validation but includes sirius metamodel.
Created attachment 251356 [details] Description that does not meet validation without sirius metamodel.
Attached two descriptions that show the need of including sirius metamodel when validating model. I use Sirius Core Runtime 3.0.0.201502261203 in Eclipse Marse 4.5 milestone.
I could reproduce the problem with your .odesign, thanks ! Indeed Sirius is, right now, not passing its own metamodels in the validator. I'm currently cleaning up this area of the code so will fix it in the same pass. In the meantime, you can avoid the validation error by being more explicit regarding the type and adding the nsPrefix : diagram::DSemanticDiagram. This gives Acceleo enough information that it find the right type himself.
New Gerrit change created: https://git.eclipse.org/r/44267
Gerrit change https://git.eclipse.org/r/44267 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=309f55a1134dccf4823b121169b651e46c91d9d5
Expression validation (In reply to Eclipse Genie from comment #10) > Gerrit change https://git.eclipse.org/r/44267 was merged to [master]. > Commit: > http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/ > ?id=309f55a1134dccf4823b121169b651e46c91d9d5 vsp-nook now valids correctly with this changes. That being said, at runtime, during expression evaluation the mechanisms and code involved are fairly different and right now there is no guarantee the Sirius runtime will pass the Sirius model EPackages to the intepreter instances which can lead to expressions using DSemantiDiagram, NodeMapping or any other type failing at runtime. To fix that I was thinking about re-using the org.eclipse.sirius.business.api.extender.MetamodelDescriptorProvider and the org.eclipse.sirius.mmdescriptor extension point with implementations in all the plugins providing new metamodels to Sirius always adding the corresponding EcoreMetamodelDescriptor. This might seems like a small "abuse" of the extension point which was, at first dedicated to "add and declare some EPackages which would have been defined in a custom way (and maybe computed based on some other model description). Team, what do you think about going this route ?
New Gerrit change created: https://git.eclipse.org/r/46061
Gerrit change https://git.eclipse.org/r/46061 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a7f6c3607df3ba4bd59d149ca101aa0d77223bc0
Cédric, your patch was merged. Does this fix the issue? Even if it does, we would need to add a regression test for it before closing the bugzilla.
(In reply to Pierre-Charles David from comment #14) > Cédric, your patch was merged. Does this fix the issue? Even if it does, we > would need to add a regression test for it before closing the bugzilla. Yes, it is now fixed both at evaluation and validation time.
validated: behavior test used at design time : validation must succeed on "Description that does not meet validation without sirius metamodel." odesign behavior test used at runtime : [view.eContainer(DSemanticDiagram).target.oclIsKindOf(EPackage)/] must work * create a modeling project with an ecore semantic resource and some classes under rootpackage * add new bugdiagram diagram => that represented classes should be elliptic
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.
New Gerrit change created: https://git.eclipse.org/r/64388
Gerrit change https://git.eclipse.org/r/64388 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c58b6ff6355a53b034ec791eff2f762ee65ba802
New Gerrit change created: https://git.eclipse.org/r/64435
New Gerrit change created: https://git.eclipse.org/r/64436
Gerrit change https://git.eclipse.org/r/64436 was merged to [v3.1.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=be2a3451f7fb50d44aee586dca082f0d036b9516
validated on sirius 3.1.4