Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [xTend] GLOBALVAR causes exception
[xTend] GLOBALVAR causes exception [message #519125] Sat, 06 March 2010 20:33 Go to next message
Eclipse UserFriend
Originally posted by: m_lehmeier.gmx.de

Hello.

After migrating from Openarchitectureware to MWE I can't define a
globalVarDef anymore.

My workflow looks like this:

My workflow looks like this:

<component class="org.eclipse.xpand2.Generator">
<fileEncoding value="UTF-8"/>
<metaModel idRef="mm.framework"/>
<expand value="com::lm::visage::m2t::framework::Pojo::main FOR
frameworkModel"/>
<globalVarDef name="javaPackage" value="com.test.something" />
</component>

I access this global var in an Xtension file by this simple function:

String packageName() : GLOBALVAR javaPackage;

As soon as that function is called, I get the following Exception:

Mar 6, 2010 9:29:45 PM
org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflo wComponent
invokeInternal
SEVERE: Error in Component of type org.eclipse.xpand2.Generator:
EvaluationException : Couldn't find type or property 'com'
nofile[0,3] on line 1 'com'

I'm not sure to proceed.
Of course I don't have to define this global, I but I would prefer to.
Can anybody tell me what I did wrong?

Thanks!

--
Lehmeier Michael
Re: [xTend] GLOBALVAR causes exception [message #519162 is a reply to message #519125] Sun, 07 March 2010 15:29 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
The text in value is interpreted as an expression an id evaluated
against the workflow context.
If you want to pass a string, you need to set the value in quotes:

<globalVarDef name="javaPackage" value="'com.test.something'" />

Sven

Michael Lehmeier schrieb:
> Hello.
>
> After migrating from Openarchitectureware to MWE I can't define a
> globalVarDef anymore.
>
> My workflow looks like this:
>
> My workflow looks like this:
>
> <component class="org.eclipse.xpand2.Generator">
> <fileEncoding value="UTF-8"/>
> <metaModel idRef="mm.framework"/>
> <expand value="com::lm::visage::m2t::framework::Pojo::main FOR
> frameworkModel"/>
> <globalVarDef name="javaPackage" value="com.test.something" />
> </component>
>
> I access this global var in an Xtension file by this simple function:
>
> String packageName() : GLOBALVAR javaPackage;
>
> As soon as that function is called, I get the following Exception:
>
> Mar 6, 2010 9:29:45 PM
> org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflo wComponent
> invokeInternal
> SEVERE: Error in Component of type org.eclipse.xpand2.Generator:
> EvaluationException : Couldn't find type or property 'com'
> nofile[0,3] on line 1 'com'
>
> I'm not sure to proceed.
> Of course I don't have to define this global, I but I would prefer to.
> Can anybody tell me what I did wrong?
>
> Thanks!
>


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:[Acceleo] Let block syntax
Next Topic:Xpand: could not find the property exception
Goto Forum:
  


Current Time: Sat Apr 27 04:21:19 GMT 2024

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

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

Back to the top