Home » Modeling » Papyrus » Validation plug-in does not use profile stereotype classes when validating model (Solved)
Validation plug-in does not use profile stereotype classes when validating model (Solved) [message #1851565] |
Fri, 08 April 2022 13:50 |
Kristian Harbo Messages: 3 Registered: April 2022 |
Junior Member |
|
|
Hello there,
EDIT 2: I solved the problem. See my reply below.
I am making a validation plug-in (among others) for a Profile plug-in in "Eclipse Modeling Tools".
Inspiration has been taken from the "Library Profile Example" (see https://github.com/bmaggi/library-training).
I've gotten to the point where the UML profile, project wizard, diagram types, palettes, property view/tab, and java-based constraint-classes (+ selectors) all register in Papyrus.]
However, when validating a model with the profile and stereotypes applied to it, the stereotype classes (generated using a "genmodel"-file) are not used.
This image shows how I validate one "SoI" model object.
This image shows the implementation of an "IClientSelector" which prints the type of the object it is checking and whether the object has type "SoI" or not.
As you can see, the SoI class (which would be org.eclipse.papyrus.acs.profile.model.impl.SoIImpl) is not "used", however, as the highlighted text shows at the end, the "SoI" type is somewhat registered.
So, even though the SoI stereotype has been applied to the model object, the model object does not have the corresponding SoI class.
I've tried to mimic the Library Profile Example to the best of my abilities, but while the library example does use the generated classes for validation (see this image), my own profile does not.
Does anyone have a suggestion as to what I am missing? Some plugin/dependency or setting perhaps?
If you need more information, I'll be happy to provide it.
Note of interest: The Profile plug-in manifest file does export the packages containing the stereotype classes.
EDIT: Since the attached images are somehow not visible to me, I've uploaded the files to a Google Drive for good measure: "https://drive.google.com/drive/folders/16oJ_SMwiOl5ddFjKAtIUCLVHCAV5IIfN?usp=sharing".
Best regards and thank you,
Kristian Harbo
[Updated on: Sun, 10 April 2022 15:34] Report message to a moderator
|
|
|
Re: Validation plug-in does not use profile stereotype classes when validating model [message #1851598 is a reply to message #1851565] |
Sun, 10 April 2022 15:32 |
Kristian Harbo Messages: 3 Registered: April 2022 |
Junior Member |
|
|
Hello again,
I've finally found the missing link. While this is not all that needs to be done in order for a profile to properly "register" in Papyrus, this part was very well hidden.
This image (also attached below) shows the general idea and is described further below:
1. In the "Project Explorer"-view, navigate to the file called something along the lines of "model.profile.uml" (located within your profile plug-in). Right-click the file and press "Open".
2. In the newly opened tree-view of the UML file, navigate to the object that represents your profile. Left-click on the object to select it.
3. In the "Properties"-view, fill in proper values on the fields "Base Package", "Ns Prefix", "Ns URI", "Package Name", and "Prefix" (refer also to the Library Profile Example for a more context-filled example).
I hope this will help someone in the future.
Best regards
Kristian Harbo
[Updated on: Sun, 10 April 2022 15:32] Report message to a moderator
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 19 04:15:42 GMT 2024
Powered by FUDForum. Page generated in 0.47879 seconds
|