Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » UML profile and Acceleo issue(Problem accessing UML profile stereotype from Acceleo)
UML profile and Acceleo issue [message #1759530] Wed, 12 April 2017 14:58 Go to next message
Guillaume Dupont is currently offline Guillaume DupontFriend
Messages: 14
Registered: April 2017
Junior Member
I am currently testing out the DSL capabilities of Papyrus in combination with Acceleo and I am currently encountering a problem.

I created a simple relational database metamodel using UML 2 profiles with Papyrus:
index.php/fa/29039/0/

I then created a gruesome library model using the meta-model defined:
index.php/fa/29038/0/

Then I created a very very simple Acceleo template file, in which I try to print some elements' stereotypes :
[template public generateElement(p : Package)]
[comment @main/]
[file (p.name.concat('_debug.txt'), false, 'UTF-8')]
Creating file for package [p.name/]
Stereotypes: [for (st : Stereotype | p.getAppliedStereotypes()) separator(',')][st.name/][/for]
[/file]
[/template]


When I use the OCL console on my model, "getAppliedStereotypes()" works just fine. But when I run my Acceleo, there is nothing behind "Stereotypes", even though the generator terminates without any error code...

Do you have any idea what is going on ?
Re: UML profile and Acceleo issue [message #1759719 is a reply to message #1759530] Mon, 17 April 2017 13:43 Go to previous messageGo to next message
Ansgar Radermacher is currently online Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
How did you reference your database profile from your model? I guess, you did not register this profile, i.e. you reference it as a profile stored in your workspace via a relative path. Acceleo has had problems with URI resolution in the past. Thus the problem might be related to this issue. You can try what happens if you use an existing, registered profile, e.g. the UML2 standard profile. Also look at the error logs.

Keep also in mind, that Acceleo loads a separate copy of your model and profile into its own resource set. Thus, it will work on the last saved state, not on the current model in a Papyrus editor.
Re: UML profile and Acceleo issue [message #1759781 is a reply to message #1759719] Tue, 18 April 2017 13:23 Go to previous messageGo to next message
Guillaume Dupont is currently offline Guillaume DupontFriend
Messages: 14
Registered: April 2017
Junior Member
I guess that makes sens considering we can only use Acceleo with registered models, though I did not think we had to do the same thing with profiles.
I can use Acceleo with any registered model, so that must be it.

Thanks a lot for your help.

Though I have now an additional question: how can I register a profile? There is no such thing as "register" in the context menu when I right-click on my UML 2 profile (ie the .uml file) like for eCore models.
Re: UML profile and Acceleo issue [message #1759857 is a reply to message #1759781] Wed, 19 April 2017 07:54 Go to previous messageGo to next message
Ansgar Radermacher is currently online Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
There is a Papyrus specific extension point that enables you to see your profile in the list of registered profiles. Typically, your profile is part of a plugin and you also specify a pathmap (which implies that you still change the profile location later without invalidating existing models that apply the profile). The snipped below shows such an example.

 <extension point="org.eclipse.emf.ecore.uri_mapping">
	<mapping
		source="pathmap://DATABASE_PROFILE/"
		target="platform:/plugin/<your plugin name>/resources/profile/"/>
</extension>

<extension point="org.eclipse.papyrus.uml.extensionpoints.UMLProfile">
	<profile
		description="My database profile"
		iconpath="platform:/plugin/<your plugin name>/resources/icons/..."
		name="Database profile"
		path="pathmap://DATABASE_PROFILE/db.profile.uml"
		provider="..."/>
</extension>

Re: UML profile and Acceleo issue [message #1759879 is a reply to message #1759857] Wed, 19 April 2017 13:21 Go to previous messageGo to next message
Guillaume Dupont is currently offline Guillaume DupontFriend
Messages: 14
Registered: April 2017
Junior Member
Thank you very much ! It works like a charm.
Re: UML profile and Acceleo issue [message #1766377 is a reply to message #1759879] Tue, 20 June 2017 18:13 Go to previous messageGo to next message
khalils khalils is currently offline khalils khalilsFriend
Messages: 1
Registered: June 2017
Junior Member
Hi Ansgar Radermacher,

We are facing a similar problem on our project.
Let me start off by including the Papyrus profile project structure index.php/fa/29726/0/

and the extension points configuration index.php/fa/29727/0/

We then exported the plugin by the means of an Eclipse plugin
index.php/fa/29728/0/index.php/fa/29729/0/

Finally we were able to add this plugin as a dependency for the Acceleo project,however we weren't able to add the meta-model into the generation .mtl file
index.php/fa/29730/0/
Re: UML profile and Acceleo issue [message #1792467 is a reply to message #1759857] Wed, 18 July 2018 10:24 Go to previous messageGo to next message
Mehreen Khan is currently offline Mehreen KhanFriend
Messages: 1
Registered: July 2018
Junior Member
Can you please clarify where we need to add this code segment in acceleo project/file??
Re: UML profile and Acceleo issue [message #1792513 is a reply to message #1792467] Wed, 18 July 2018 19:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6046
Registered: July 2009
Senior Member
Hi

If you pick up an old thread, you need to be much clearer. The preceding comment has no code to add. The comment preceding "Thank you very much ! It works like a charm." added extension points to plugin.xml, but I wouldn't call extension points code.

What do you want? What have you tried?

Regards

Ed Willink
Re: UML profile and Acceleo issue [message #1792546 is a reply to message #1792513] Thu, 19 July 2018 11:12 Go to previous message
Ansgar Radermacher is currently online Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

as already said, the problem is not clear. Does Acceleo work with your profile in the 2nd (debug) instance, but not when deployed? In this case, check whether the build.properties contain the profile (at least the .uml file).

Ansgar
Previous Topic:how to find or downloading SysML 1.4 in papyrus-photon-4.0.0
Next Topic:Papyrus 3.0.0 - Where is SysML profile?
Goto Forum:
  


Current Time: Wed Sep 26 12:16:56 GMT 2018

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

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

Back to the top