Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL: How to define and use a profile and stereotypes in a model validation
EVL: How to define and use a profile and stereotypes in a model validation [message #1730972] Sun, 01 May 2016 08:45 Go to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Hi,

Considering the following code to create a non-existing class stereotype:
pre {
	// getting the existing FooProfile 
	var MyProfile = ProfileModel.select(p|p.name = "FooProfile");
}

.
.
.
if (not Stereotype.all.exists(s|s.name = "foo"))
{
	// define a new stereotype named with the given name
	var stereotype: Stereotype = Stereotype.createInstance();
	stereotype.name = "foo";
	stereotype.package = MyProfile;
	stereotype.feature = "base_Class";	
}
else
{
	("foo" + " exists!").println();
}
.
.
.


1) The following error is raised when I apply the code in a UML model validation:
Cannot find meta-class 'foo' in model ''

I think, it is required here to store the created stereotype "foo" in my profile model too. Is this true? How can I add the created stereotype to my profile model file (here ProfileModel)?

2) I want to create a UML profile from scratch, i.e., the profile must be created in the pre section of my EVL module. How can I create this profile in the EOL language?

Best regards,
Alireza

[Updated on: Sun, 08 May 2016 09:13]

Report message to a moderator

Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731239 is a reply to message #1730972] Tue, 03 May 2016 17:02 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

I suspect that you'll need to re-apply the modified profile to your UML model.

Cheers,
Dimitris
Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731244 is a reply to message #1731239] Tue, 03 May 2016 18:14 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

Hi,

Thanks a lot for the reply. Do you suggest any trick to the (2) question?

Best regards,
Alireza
Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731247 is a reply to message #1731244] Tue, 03 May 2016 18:21 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

To create a profile on the fly you can add an empty UML model in your run configuration that will host your stereotypes etc.

Cheers,
Dimitris
Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731248 is a reply to message #1731247] Tue, 03 May 2016 18:25 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Thanks a lot.

Best regards,
Alireza
Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731352 is a reply to message #1731248] Wed, 04 May 2016 13:51 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Hi all,

I like to define stereotypes which extend metaclasses like Classifier, Operation, etc. Is there any solution to modify the following code in EOL to resolve my problem?

if (not Stereotype.all.exists(s|s.name = "foo"))
	{
		// define a new stereotype named with the "foo" name here
		var stereotype: Stereotype = Stereotype.createInstance();

               // the following line raises error,
               // even for the string "base_Class" in the right-hand side too
		stereotype.metaclass = "base_Classifier";
		stereotype.name = "foo";
		stereotype.package = MyProfile; 
	}
else
	{
		("foo already exists!").println();
	}	 			


Thanks
Alireza

[Updated on: Wed, 04 May 2016 16:58]

Report message to a moderator

Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731381 is a reply to message #1731352] Wed, 04 May 2016 18:14 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Which property of Stereotype [1] are you trying to assign using the line in question?

Cheers,
Dimitris

[1] http://download.eclipse.org/modeling/mdt/uml2/javadoc/5.0.0/org/eclipse/uml2/uml/Stereotype.html
Re: EVL: How to define and use a profile and stereotypes in a model validation [message #1731392 is a reply to message #1731381] Wed, 04 May 2016 21:02 Go to previous message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

Hi,

Thanks a lot for your help. I created another topic to illustrate the problem with more detail. Please, see https://www.eclipse.org/forums/index.php?t=msg&th=1077253&goto=1731626&#msg_1731626.

Best regards,
Alireza

[Updated on: Sun, 08 May 2016 09:21]

Report message to a moderator

Previous Topic:call java class which has a method from ANT build file
Next Topic:Query in ETL -Accessing the Target Node Parent?
Goto Forum:
  


Current Time: Thu Mar 28 23:42:00 GMT 2024

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

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

Back to the top