Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPAND]Unkown type while accessing multiple models([XPAND]Unkown type while accessing multiple models)
[XPAND]Unkown type while accessing multiple models [message #1693757] Tue, 28 April 2015 07:43 Go to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi,
i have registered metamodel in generator
<registerGeneratedEPackage value="autosar40.util.Autosar40Package"/>

-luckystar


>>>make sure the metamodel you use is registered?!?
>>>which one is used in the generator?!?
>>>is one explicitely configured or is it the default

Re: [XPAND]Unkown type while accessing multiple models [message #1693835 is a reply to message #1693757] Tue, 28 April 2015 16:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
Which metamodel contributor is used by the generator component ???
Javabeans emfregistry ...
Maybe you need to register autosar subpackages separately


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1693881 is a reply to message #1693835] Wed, 29 April 2015 06:06 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
i am using org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel emfregistry and my generator component is using EMF Metamodels,sphinx-managed Metamodels and ECU configuration TypeSystem metamodel contributors....

[Updated on: Wed, 29 April 2015 06:20]

Report message to a moderator

Re: [XPAND]Unkown type while accessing multiple models [message #1693920 is a reply to message #1693881] Wed, 29 April 2015 09:52 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi
how can i register autosar subpackages in generator?
currently i want to get AUTOSAR::EcucDefs::Rte module/type in the template file
please suggest me on this

Thank you.
Re: [XPAND]Unkown type while accessing multiple models [message #1693984 is a reply to message #1693920] Wed, 29 April 2015 19:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
No Message Body

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1693985 is a reply to message #1693984] Wed, 29 April 2015 19:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
id recommend you to use javabeans metamodel.
never the less what about calling registergeneratedepackage multiple times?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694024 is a reply to message #1693985] Thu, 30 April 2015 07:26 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi
ya i have used javabeans metamodel also but same error i am getting
and what is the use of calling the registergeneratedpackage multiple times...even though it is not getting the typesystem.
Any other approach i need to follow, please help on this

thank you.
Re: [XPAND]Unkown type while accessing multiple models [message #1694028 is a reply to message #1694024] Thu, 30 April 2015 07:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
sorry i cannot help you with that.
i bet if you use javabeans you dont get the same error.
so please post the complete workflow log.
or debug the metamodel contribution.
or switch to the new xtend(2) that uses java


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694051 is a reply to message #1694028] Thu, 30 April 2015 09:19 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi,
here i am sharing my workflow....
please look into this and suggest me if you have any solution


<?xml version="1.0"?>
<workflow>
<property name="model" value="Test_Rte/bswconfig/Appl_Rte_SREXP_INTER_Ecu.arxml" />
<property name="systemmodel" value="Test_Rte/fibexconfig/Appl_Rte_SREXP_INTER.arxml" />
<property name="genPath" value="src-gen" />

<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
<registerGeneratedEPackage
value="autosar40.util.Autosar40Package"/>
<extensionMap>
<from value="arxml" />
<to value="autosar40.util.Autosar40ResourceFactoryImpl" />
</extensionMap>
</bean>

<!-- instantiate metamodel -->
<bean id="mm_emf" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<bean id="myRS" class="org.examples.aal.standalone.StandaloneResourceSet"/>

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

<bean id="myRS1" class="org.examples.aal.standalone.StandaloneResourceSet"/>
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="model" />
<uri value="platform:/resource/${model}" />
<resourceSet idRef="myRS1"/>
</component>

<!-- Clear output directory -->
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value="${genPath}"/>
</component>

<!-- check model -->
<!--<component class="org.eclipse.xtend.check.CheckComponent">
<metaModel idRef="mm_emf"/>
<checkFile value="metamodel::Checks" />
<emfAllChildrenSlot value="model" />
</component> -->

<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm_emf"/>
<metaModel class="org.eclipse.xtend.type.impl.java.JavaBeansMetaModel" />
<expand
value="templates::Rte::RteGenerate(model) FOR systemmodel" />
<!--<fileEncoding value="Cp1252"/>-->
<genPath value="${genPath}"/>

<!--<metaModel class="org.eclipse.xtend.type.impl.java.JavaBeansMetaModel" />-->
</component>
</workflow>
Re: [XPAND]Unkown type while accessing multiple models [message #1694056 is a reply to message #1694051] Thu, 30 April 2015 09:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
Hi

with <metaModel idRef="mm_emf"/> use emf

but here

<registerGeneratedEPackage
value="autosar40.util.Autosar40Package"/>

you register only the autosar toplevel package.

i dont know what the emfRegistryMetamodel does in this case.


you may debug that class.
e.g. at org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel.getTypeForName(String) or other places.


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694451 is a reply to message #1694056] Tue, 05 May 2015 12:00 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi,
i have debugged org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel class separately, then it is showing the list of typesystems in the console...but when i am calling the typesystem in the template file it is showing the error.
and i have tried calling org.eclipse.xtend.type.impl.java.JavaBeansMetaModel class instead of org.eclipse.xtend.typesystem.emf.EmfRegistryMetamodel class also in the workflow file then it is showing the error(no defination found)



Re: [XPAND]Unkown type while accessing multiple models [message #1694459 is a reply to message #1694451] Tue, 05 May 2015 12:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
Hi,

did you change the imports for the java beans metamodel from package::ClassName to full::qualified::java::ClassName


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694464 is a reply to message #1694459] Tue, 05 May 2015 13:17 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
No, i have not changed anything in the workflow file other than the JavaBeansMetaModel class
can you tell me where exactly i should change the imports?

Thank you.



Re: [XPAND]Unkown type while accessing multiple models [message #1694466 is a reply to message #1694464] Tue, 05 May 2015 13:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
if the error says:

no definition abc for for xyz

and you have a <<define abc for deg>> then you should consider to have a <<define abc for xyz>>
shouldn't you.

p.s.:

i strictly recommend you to read the xpand documentation http://help.eclipse.org/indigo/topic/org.eclipse.xpand.doc/help/emf_tutorial.html


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694685 is a reply to message #1694466] Thu, 07 May 2015 07:33 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
Hi,
Even though i am using the JavaBeansMetaModel class and the same error i am getting(Workflow interrupted. Reason: Unknown type 'AUTOSAR::EcucDefs::Rte'), do i have to make any changes in my workflow?
Please suggest me

Thank you.



Re: [XPAND]Unkown type while accessing multiple models [message #1694689 is a reply to message #1694685] Thu, 07 May 2015 07:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
are you sure you only use javabeans and not emf. how does your root template look like?
BTW: where does this strange Rte type come from? i dont know it to be a autosar class.
so how do you get it?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694715 is a reply to message #1694689] Thu, 07 May 2015 10:45 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
yes, i am using only javabeans class (not emfregistry class) in my workflow file...
Rte is a autosar class(module)
this rte is one of the classes/modules of a model file which i am trying to access this by calling AUTOSAR::EcucDefs::Rte typesystem

and below is the root template

«DEFINE RteGenerate(autosar40::autosartoplevelstructure::impl::AUTOSARImpl model) FOR autosar40::autosartoplevelstructure::impl::AUTOSARImpl»
«EXPAND Rte_Type_H(model)»
«ENDDEFINE»


«DEFINE Rte_Type_H(autosar40::autosartoplevelstructure::impl::AUTOSARImpl model) FOR autosar40::autosartoplevelstructure::impl::AUTOSARImpl»
«FILE "Rte_Type.h" -»
«EXPAND Rte_Type_H::include_Type_H(model) FOR this»
«ENDFILE»
«ENDDEFINE»

As i am new to this XPAND Please correct me if i am wrong any where
Thank you.
Re: [XPAND]Unkown type while accessing multiple models [message #1694725 is a reply to message #1694715] Thu, 07 May 2015 12:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
HI,

please tell me the artop class of AUTOSAR::EcucDefs::Rte.

the template you show use only AUTOSAR as type, nothing else.
please fill the gaps


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694732 is a reply to message #1694725] Thu, 07 May 2015 12:56 Go to previous messageGo to next message
lucky star is currently offline lucky starFriend
Messages: 44
Registered: April 2015
Member
EcucModuleDef is the class for AUTOSAR::EcucDefs::Rte

Re: [XPAND]Unkown type while accessing multiple models [message #1694738 is a reply to message #1694732] Thu, 07 May 2015 13:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
Hi,

i do not understand
then the definition should be

autosar40::ecucparameterdef::EcucModuleDef
or
autosar40::EcucModuleDef
or something like that

so where do you create the object of type
AUTOSAR::EcucDefs::Rte
do you wrap the EcucModuleDef somehow?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [XPAND]Unkown type while accessing multiple models [message #1694739 is a reply to message #1694732] Thu, 07 May 2015 13:28 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12114
Registered: July 2009
Senior Member
you you create a wrapper or something like that?

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[acceleo] and [cdo] How does I open my model
Next Topic:OCL Constraint to java code
Goto Forum:
  


Current Time: Sun Jul 22 08:13:49 GMT 2018

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

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

Back to the top