Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Custom field on Property object in metamodel(How to create a custom field (free text as string type) associated with evry Property in the IBM RSA Model)
Custom field on Property object in metamodel [message #1785678] Wed, 18 April 2018 09:50 Go to next message
José Torres is currently offline José TorresFriend
Messages: 9
Registered: January 2018
Junior Member
Hi,

I need to apply a custom field (free text as string type) on the Property object of my model.

I read the article : https://www.eclipse.org/modeling/mdt/uml2/docs/articles/Customizing_UML2_Which_Technique_is_Right_For_You/article.html

So the right technique to use is "Lightweight extension".

I tried to modify the Property object in the Profile applied to the UML model but it reports a violation error.

How to extend the Property object in the metamodel ?

Thank you, José
Re: Custom field on Property object in metamodel [message #1785680 is a reply to message #1785678] Wed, 18 April 2018 10:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
Hi

Yes. This is the right forum, but you have ignored the rest of the answer on the EMF newsgroup.

"Your snapshot is far from clear as to what you are doing where. It looks as if you attempting to modify the Property definition in the UML metamodel rather than a Property instance in your UML model. I suggest you follow some simpler tutorials so that you understand the difference.

It is also unclear why a normal Property with a String type needs customization for you."


Regards

Ed Willink
Re: Custom field on Property object in metamodel [message #1785693 is a reply to message #1785680] Wed, 18 April 2018 12:13 Go to previous messageGo to next message
José Torres is currently offline José TorresFriend
Messages: 9
Registered: January 2018
Junior Member
Ok,

1) I have attached 5 screenshots for each step leading to the violation

2) "rather than a Property instance in your UML model" => in fact i need to attach special information to each instance of property (around 1500) in my model. This information must not be produced by the java transformer. This information is not part of the model and must not be delivered to our clients (application written in java)

Thank you, José
Re: Custom field on Property object in metamodel [message #1785697 is a reply to message #1785693] Wed, 18 April 2018 13:43 Go to previous messageGo to next message
German Vega is currently offline German VegaFriend
Messages: 51
Registered: December 2015
Member
Hello

From your screenshots it seems that you are trying to directly modify the UML metamodel, this is not really "Lightweight".

In your first post you mentioned you wanted to use the "Lightweight extension" approach, that means defining and using a profile. To "attach" information to a property, you create a profile, and you define an stereotype that applies to metaclass "Property" and then you add attributes to the stereotype (not to the metaclass).

I think you first need to better understand how profiles work on UML, a good tutorial using papyrus is https://www.eclipse.org/papyrus/resources/PapyrusUserGuideSeries_AboutUMLProfile_v1.0.0_d20120606.pdf

Hope this helps

German Vega
Re: Custom field on Property object in metamodel [message #1785700 is a reply to message #1785697] Wed, 18 April 2018 14:22 Go to previous messageGo to next message
José Torres is currently offline José TorresFriend
Messages: 9
Registered: January 2018
Junior Member
Hi,

In fact i dont know what i need to use ("Lightweight" or anything else).

But if i take into account what you said i understand now the violation error.

So extending the metamodel (to add one custom attribute of type string attached to the Property) takes to go for "Middleweight" implementation => https://www.eclipse.org/modeling/mdt/uml2/docs/articles/Customizing_UML2_Which_Technique_is_Right_For_You/article.html#_Hlt174419544

I searched on how to handle with the file (or what seems to be a file) "UML.metamodel.uml" but did not find it on the IBM RSA directories on disk. And also did not find any tuto on the web.

Do you know where i can find such a tuto ?

Thank you, José
Re: Custom field on Property object in metamodel [message #1785704 is a reply to message #1785700] Wed, 18 April 2018 15:04 Go to previous messageGo to next message
German Vega is currently offline German VegaFriend
Messages: 51
Registered: December 2015
Member
Hi

It is difficult to give you advice without knowing your requirements, but be aware that both the "Middleweight" and "Heavyweight" approaches are long term and very difficult endeavors.

In both "Middleweight" and "Heavyweight" you end up defining a new "customized" UML metamodel, and the existing UML tools will not work out of the box with it (for instance, the UML editor knows nothing about your new attributes and so you will not be able to edit a model with your extensions)

I suggest you to make it work with the "Lightweight" approach (defining a profile), and evaluate if it fits or not your needs, before embarking in some endless and very difficult metamodel definition

Re: Custom field on Property object in metamodel [message #1785706 is a reply to message #1785704] Wed, 18 April 2018 15:34 Go to previous messageGo to next message
José Torres is currently offline José TorresFriend
Messages: 9
Registered: January 2018
Junior Member
Ok,

I'm just trying to POC the Middleweight approach so i'm desperately searching for a minimal tuto.

Thank you, José
Re: Custom field on Property object in metamodel [message #1785740 is a reply to message #1785706] Thu, 19 April 2018 08:25 Go to previous message
German Vega is currently offline German VegaFriend
Messages: 51
Registered: December 2015
Member
Hello,

I do not think that there is such a thing as a "minimal tuto" for the Middleweight /Heavyweight approaches, they require deep knowledge of the UML metamodel and the eclipse modeling technologies (UML2, ecore, genmodel, UML2ecore transformation, ecore2Java generation, etc)

As the article itself points out

Quote:
As you continue to read about the techniques for extending UML, you should keep the following in mind:

As much as possible, you should be favoring the "lightweight approach" or the use of profiles.
As much as possible, you should be leaning away from the use of "middleweight" extensions.


Quote:
The main conclusion of this article is: The use of Middleweight extensions is discouraged and Lightweight extensions should be your first instinct. Heavyweight extensions should be used in rare cases where much control is required.


If you insist, you can find the file "UML.metamodel.uml" file in plugin org.eclipse.uml2.uml.resources (I don't know if it is the same for IBM RSA, I am not a user of IBM RSA and I do not how how it differs from the Eclipse open source UML2 project) ... you can import it into your workspace and extend it ... but then if you want to do something useful you will need to generate a java implementation from your model ... and that is very customized process ... personally I have never done it, so I can not help with it .... my personal feeling is that even the smaller POC will take you days, if not weeks ... unless you are very familiar with UML2 project ... but experts in the group (I am just a user of the UML2 project, not a committer) may have a clearer view ...

Perhaps if you come back to your initial needs (why do you need to add attributes to Properties of your model?) and explain us what you want to achieve, we can better guide you
Previous Topic:Convert .uml to .ecore in Oxygen
Next Topic:OMG XMI to Eclipse UML or to Ecore - best option?
Goto Forum:
  


Current Time: Sun Sep 23 06:05:10 GMT 2018

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

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

Back to the top