Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Problems with generated static profile
Problems with generated static profile [message #1752816] Fri, 27 January 2017 15:33 Go to next message
nicolas metayer is currently offline nicolas metayerFriend
Messages: 4
Registered: December 2016
Location: Montréal, Canada
Junior Member
Hello,

I'm currently trying to debug two problems I'm facing with my DSL.

I have created my profile and I followed the guideline provided in [1] to generate a static profile.

I believe that the problems are related to a bad generation of my static profile:
-Problem 1:
My profile offers the possibility to use template to initialize a new model. Using the org.eclipse.papyrus.uml.diagram.wizards.templates extension point.
When I create a new model from a template, the stereotype repair wizard always appears. The repair actions is working correctly and once complete the newly created model is correctly initialized.

-Problem 2:
My profile offers validation through constraints written in Java using the org.eclipse.emf.validation.constraintProviders and org.eclipse.emf.validation.constraintBindings extension points. I used the SysML validation plugin to see how things should be done.
My validation plugin has been generated using the provided Papyrus DSML validation plugin. The generated selectors seem to return correct values when executed, however the java constraints are not executing.


I believe that these problems are related to the static generation of my profile because I had no problem to create new constraints and templates for the Library example [3] and SysML [2].

I have tried to fill the Ecore profile information as explained in [1] without success. I have also tried to fill the Ecore profile informations as it's done with the SysML profile [2] and the example provided in [3] again without sucess.
When I do fill these informations (the <<EPackage>> stereotype), I cannot apply my profile's stereotype to the UML element to which they can be applied.

The various attempts (filling the Ecore profile data and leaving those informations emtpy) that I have made to try to fix these problems were not successfull.

As I dont really know what else to try or where to look, could you provide me with some explanation on the things that I must have done incorrectly?
In case where my problems are not related to the static generation of the profile, could you point me to the elements that I should be looking at?


I have joined a project example that reproduces the structure of my profile:

It contains two profile models, one with the Ecore profile informations filled and the other does not fill the Ecore profile informations.
The static profile is generated from the model that does not have the Ecore profile informations filled as requested in [1].
With this example, I can create any of the profile's stereotype without problem.
The use of a template to initialize new model results in the opening of the stereotype repair dialog.
When I try to validate a model that contains elements of the profile, the constraints are not executed although the selectors identify correctly the stereotypes.



Regards,
Nicolas






[1] Generating Static Profiles: http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.papyrus.uml.diagram.profile.doc%2Ftarget%2Fgenerated-eclipse-help%2Fusers%2FgeneratingStaticProfiles.html
[2] SysML profile model: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus-sysml.git/tree/core/org.eclipse.papyrus.sysml14/resources/profile
[3]Library example: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/examples/library/org.eclipse.papyrus.training.library.profile/model?h=streams/2.0-maintenance
  • Attachment: project.zip
    (Size: 96.99KB, Downloaded 62 times)
Re: Problems with generated static profile [message #1752952 is a reply to message #1752816] Tue, 31 January 2017 09:23 Go to previous messageGo to next message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 129
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi Nicolas,

Problem 2:
For information, neither SysML 1.4 nor the Library example use the DSML Validation generator.
In your project1.validation\plugin.xml , the constraint is missing the class attribute (It should refer to your Java class).

Problem 1:
When opening the model used as template, it should open correctly (without pop-up)
Copy/paste your model in your workspace runtime and you will see that it's not the case.

I don't have any simple solution for this one.
I would advice you against using too many sub profile and defining too many times your profile.

Each time you define your profile, it creates a versioned copy inside your profile.uml file and this may be use to upgrade your profile.
It's really useful for handling change for user but will create many tricky problems when used in a fast development process.

Regards,
Benoit

Ps: I'm aware that the default saving pop-up will propose you to define your profile,
IMHO I don't think it's a good idea, It's something historical I will ask if there is a good reason to maintain it that way.





Re: Problems with generated static profile [message #1752997 is a reply to message #1752952] Tue, 31 January 2017 21:18 Go to previous message
nicolas metayer is currently offline nicolas metayerFriend
Messages: 4
Registered: December 2016
Location: Montréal, Canada
Junior Member
Hi benoit,

Thank you for your answer.

With the answers you have provided, I have created again from scratch a new project that is similar to the one I have provided in my first message.
I have removed the sub profiles, and only defined the profile once it was complete.
However the two problems continue to be present.

I will try to update from papyrus 2.0.1 to 2.0.2 and try again from scratch and see if it help, as I do not really know what else to try.

Problem 2:
Quote:
In your project1.validation\plugin.xml , the constraint is missing the class attribute (It should refer to your Java class).

My bad, I have built this example a little bit too fast i guess.

However even when the attribute points to the correct java class, the constraint is not executed which is quite strange as I reproduce the exact same steps that I did when I successfully created constraints for the library example in order to understand how it should be done.

Problem 1:
Quote:
When opening the model used as template, it should open correctly (without pop-up)
Copy/paste your model in your workspace runtime and you will see that it's not the case.

Could this behavior be due to the fact that I create the template from a debug runtime instance of Papyrus?


Regards,
Nicolas
Previous Topic:diagram empty
Next Topic:Papyrus in RCP
Goto Forum:
  


Current Time: Fri Jan 24 10:19:18 GMT 2020

Powered by FUDForum. Page generated in 0.02614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top