Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand / Xtend] Recognizing custom UML Profile(How can I import my custom Profile)
[Xpand / Xtend] Recognizing custom UML Profile [message #639025] Sun, 14 November 2010 20:53 Go to next message
Muba  is currently offline Muba Friend
Messages: 20
Registered: November 2009
Junior Member

I have created a really simple uml profile and a uml model which uses this profile (uml2 3.0.0).

I think I am loading the profile correctly in my workflow, but I do not know what I have to do so that the Xpand and Xtend editor will recognize my profile and its stereotypes.

I am not using packages in my uml models (neither in the sample.uml nor in the Forms.profile.uml). I guess that does not have to do anything with it, does it?
Both uml files are not within my Xpand project, but in their own projects.

I am using eclipse helios and I create my uml models with papyrus.

Where in my Xpand project do I have to add my Profile so the editors will recognize my profile (e.g. so that I can import that profile)?

I dont think just loading it in the workflow (see below) will do it, right?

I searched the forums and the internet. Either I haven't found the answer yet, or it should have worked like that.
Since I do not know what to do, I hope someone here can help me out.

<?xml version="1.0"?>
	<property name="model" value="GoogleFormsUML/Sample.uml" />
	<property name="profile" value="UMLProfiles/Forms.profile.uml" />
	<property name="src-gen" value="src-gen" />
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
		<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>		
	<!-- instantiate metamodel -->
	<bean id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>

	<!-- Profile Model -->
	<bean id="formsProfile" class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
		<profile value="platform:/resource/${profile}" />

	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/${model}" />
		<modelSlot value="model" />
		<!--  generate code -->
	<component class="org.eclipse.xpand2.Generator">
		<metaModel idRef="mm"/>
		<metaModel idRef="formsProfile"/>
			value="template::template::main FOR model" />
		<outlet path="${src-gen}" >
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
Re: [Xpand / Xtend] Recognizing custom UML Profile [message #639026 is a reply to message #639025] Sun, 14 November 2010 21:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14653
Registered: July 2009
Senior Member

here is a uml sample workflow for xpand

	<bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".." />
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/xpand.uml.profile.sample/src/model/test.uml" />
		<modelSlot value="model" />
	<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
		<directory value="src-gen" />
	<component class="org.eclipse.xpand2.Generator">
		<metaModel class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
			<profile value="platform:/resource/xpand.uml.profile.sample/src/model/test.profile.uml" />
		<metaModel class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
		<expand value="template::Template::main FOR model" />
		<outlet path="src-gen" >
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />


to get the editor running you have to enable uml profiles in your generator projects xtend/xpand properties. the files should be on the classpath.


Twitter : @chrdietrich
Blog :

[Updated on: Sun, 14 November 2010 21:46]

Report message to a moderator

Re: [Xpand / Xtend] Recognizing custom UML Profile [message #641826 is a reply to message #639026] Sun, 28 November 2010 15:01 Go to previous message
Muba  is currently offline Muba Friend
Messages: 20
Registered: November 2009
Junior Member

sorry that I did not reply sooner, but due to some stuff I couldn't get back to this project until now.

After putting the profile in my src folder and activating the uml2 Profile everything works fine.

Thank you very much.

Previous Topic:[XPand] Invoke XPand programmatically: how templates are resolved?
Next Topic:[Xpand] Merging several models into one output (file)
Goto Forum:

Current Time: Wed Feb 28 03:53:39 GMT 2024

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

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

Back to the top