Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification'
Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification' [message #508120] Sat, 16 January 2010 07:20 Go to next message
Siamak Haschemi is currently offline Siamak HaschemiFriend
Messages: 13
Registered: January 2010
Junior Member
Hello,

when I create a new Xpand Project (my.generator.project), add the dependency to the uml metamodel and write the following template definitions:

«DEFINE foo FOR uml::Constraint-»
  «EXPAND foo FOR specification»
«ENDDEFINE»

«DEFINE foo FOR uml::ValueSpecification-» 
«ENDDEFINE»


the editor shows me the strange error:

Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification'

Here's my MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: my.generator.project
Bundle-SymbolicName: my.generator.project; singleton:=true
Bundle-Version: 1.0.0
Require-Bundle: org.eclipse.xpand,
 org.eclipse.xtend,
 org.eclipse.xtend.typesystem.emf,
 org.eclipse.uml2.uml
Bundle-RequiredExecutionEnvironment: J2SE-1.5



The workflow is the standard one from the example project created with the "new XPand Project Wizard":

<?xml version="1.0"?>
<workflow>
	<property name="model" value="my.generator.project/src/Model.xmi" />
	<property name="src-gen" value="src-gen" />
	
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.mwe.emf.StandaloneSetup" >
		<platformUri value=".."/>
	</bean>

	<!-- load model and store it in slot 'model' -->
	<component class="org.eclipse.mwe.emf.Reader">
		<uri value="platform:/resource/${model}" />
		<modelSlot value="model" />
	</component>

	<!-- check model -->
	<component class="org.eclipse.xtend.check.CheckComponent">
		<metaModel id="mm"
			class="org.eclipse.m2t.type.emf.EmfRegistryMetaModel"/>
		<checkFile value="metamodel::Checks" />
		<emfAllChildrenSlot value="model" />
	</component>

	<!--  generate code -->
	<component class="org.eclipse.xtend.xpand2.Generator">
		<metaModel idRef="mm"/>
		<expand
			value="template::Template::main FOR model" />
		<outlet path="${src-gen}" >
			<postprocessor class="org.eclipse.xtend.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>
</workflow>


I use Eclipse Galileo Build id: 20090920-1017. The XPand plugin version is 0.7.2.v200908120436. The plugin 'org.eclipse.uml2.uml' has the version 3.0.1.v200908281330

What went wrong?


Cheers
Re: Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification' [message #508269 is a reply to message #508120] Mon, 18 January 2010 08:28 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Do you have an 'ocl' import in that file?
If not it seems to be a bug and it would be very appreciated if you
could report it in bugzilla.

Sven

Siamak Haschemi schrieb:
> Hello,
>
> when I create a new Xpand Project (my.generator.project), add the
> dependency to the uml metamodel and write the following template
> definitions:
>
> «DEFINE foo FOR uml::Constraint-»
> «EXPAND foo FOR specification»
> «ENDDEFINE»
>
> «DEFINE foo FOR uml::ValueSpecification-» «ENDDEFINE»
>
> the editor shows me the strange error:
>
> Unknown ocl::uml::Constraint propery, variable, type or enumeration
> literal 'specification'
>
> Here's my MANIFEST.MF
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: my.generator.project
> Bundle-SymbolicName: my.generator.project; singleton:=true
> Bundle-Version: 1.0.0
> Require-Bundle: org.eclipse.xpand,
> org.eclipse.xtend,
> org.eclipse.xtend.typesystem.emf,
> org.eclipse.uml2.uml
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>
>
>
> The workflow is the standard one from the example project created with
> the "new XPand Project Wizard":
>
> <?xml version="1.0"?>
> <workflow>
> <property name="model" value="my.generator.project/src/Model.xmi" />
> <property name="src-gen" value="src-gen" />
>
> <!-- set up EMF for standalone execution -->
> <bean class="org.eclipse.mwe.emf.StandaloneSetup" >
> <platformUri value=".."/>
> </bean>
>
> <!-- load model and store it in slot 'model' -->
> <component class="org.eclipse.mwe.emf.Reader">
> <uri value="platform:/resource/${model}" />
> <modelSlot value="model" />
> </component>
>
> <!-- check model -->
> <component class="org.eclipse.xtend.check.CheckComponent">
> <metaModel id="mm"
> class="org.eclipse.m2t.type.emf.EmfRegistryMetaModel"/>
> <checkFile value="metamodel::Checks" />
> <emfAllChildrenSlot value="model" />
> </component>
>
> <!-- generate code -->
> <component class="org.eclipse.xtend.xpand2.Generator">
> <metaModel idRef="mm"/>
> <expand
> value="template::Template::main FOR model" />
> <outlet path="${src-gen}" >
> <postprocessor
> class="org.eclipse.xtend.xpand2.output.JavaBeautifier" />
> </outlet>
> </component>
> </workflow>
>
> I use Eclipse Galileo Build id: 20090920-1017. The XPand plugin version
> is 0.7.2.v200908120436. The plugin 'org.eclipse.uml2.uml' has the
> version 3.0.1.v200908281330
>
> What went wrong?
>
>
> Cheers


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification' [message #521039 is a reply to message #508269] Tue, 16 March 2010 10:06 Go to previous message
Siamak Haschemi is currently offline Siamak HaschemiFriend
Messages: 13
Registered: January 2010
Junior Member
Hi Sven,

I uploaded a test project, where the problem is reproducable (http:// www2.informatik.hu-berlin.de/~haschemi/transfer/my.generator .project.zip)

I think that the problem is related to different *.ecore metamodels using the same names. Here's some other related output form the console:

Multiple types (2) with name uml::Constraint found!
Multiple types (2) with name uml::SendSignalAction found!
Multiple types (2) with name ocl::expressions::OCLExpression found!


But I don't know whether this is a M2T or a EMF Bug.


Cheers,
Siamak
Previous Topic:[Xtend] creating an element results in a List[Object]
Next Topic:HOWTO setup a mapping (uml2 profile)
Goto Forum:
  


Current Time: Thu Oct 03 17:21:45 GMT 2024

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

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

Back to the top