|
Re: SuperClass gets displayed with SubClass [message #1810268 is a reply to message #1810266] |
Tue, 06 August 2019 09:31 |
|
Hello,
If I understood correctly, in your VSM (.odesign file), you have two mappings, one where the domain class is "exampleProject::ClassA" and another one where the domain class is "exampleProject::SubClassA1". On the first one you added the semantic candidate expression "self.classa.oclIsTypeOf(exampleProject::ClassA)", have you set the equivalent semantic candidate expression on the second mapping? Can you check that you have not used oclIsKindOf somewhere? This one is valid for a supertype.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: SuperClass gets displayed with SubClass [message #1810280 is a reply to message #1810269] |
Tue, 06 August 2019 13:07 |
|
Hello,
Ok I think I have a better understanding with the screenshot. I hadn't noticed the first time, but with your expression you are trying to do two thing at once, identify candidates and filter by type so you should use oclAsType to cast, instead of oclIsTypeOf that returns a boolean.
If it is easier, you can do it in two steps. For your candidate expression, you can use only aql:self.classa, as it is the reference in your metamodel. Note that you can also use the expression "feature:classa" that is more performant. Then you want to filter by type, this can be done in the "Precondition Expression" field in the advance tab. Here the expression will be aql:self.oclIsTypeOf(exampleProject::ClassA) or SubClassA1 depending on the mapping.
Concerning the errors about the unaccessible types, can you check that in the Manifest.MF file of your project, you have a dependency to your metamodel? Also, in your .odesign, if you select your DiagramDescription "exampleDiagram", you can go to the metamodel tab and add your metamodel using the registry or the workspace. This should further check that you have access to your metamodel.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: SuperClass gets displayed with SubClass [message #1810285 is a reply to message #1810283] |
Tue, 06 August 2019 14:12 |
|
Great!
You should be able to add the dependency to the metamodel, whether your "Viewpoint Specification Project" (the one with the .odesign file) is in the same workspace or in a runtime. How did you create the metamodel project? With the "EMF Project" wizard? Is it a plugin project?
On a different topic, in your initial post, you said that you found that you needed to use the "semantic candidate expression". As you have noticed this field gives Sirius the information on how to select candidate elements for a mapping. If this field is not set, then only the Domain Class provides this information. This means that Sirius will look every element of the model to find a candidates. As you can guess, this is not as performant.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.04048 seconds