Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Problem loading referenced types(Problem resolving indirectly referenced metamodels)
Problem loading referenced types [message #529380] Sat, 24 April 2010 10:26 Go to next message
Mark Tippetts is currently offline Mark TippettsFriend
Messages: 25
Registered: July 2009
Junior Member
I'm trying to run the following EGL module. I've tried this using both Ant and a launch configuration, with the same results. It almost works.

Basically, what I'm working on is yet another API documentation generator.

GenerateTextile.egl defines part of a strategy for documenting an Eclipse product or feature, based on logical and architectural models of the feature. This template is called from a dispatcher, GenerateDocumentation.egl, which also calls on modules that create cheatsheets, a help context registry and toc files. Those work well enough.

The purpose of this final sub-module is to create input to the Mylyn WikiText editor, using Textile syntax (Foo*.textile). The implementation serializes a graph of nodes and links by choosing a template snippet, based on the class of the object described by the node or link.

The input file, Foo.help, references two other models, Foo.arch and Foo.logic. Each of these models is based on a different metamodel. That's the root of the trouble.

Originally, I tried this.

[% 
root.println('Processing ');
if (root.focus.isDefined()){
	root.write(root.focus);
}

operation help!DocElement write(focus : architecture!InterfacePart){%]
h1.[%=self.focus.kind.name%] [%=self.name%]
[%
	if (self.text.isDefined()){%]
[%=self.text%]
[%	}
	
	if (self.focus.hosts.isDefined()){%]
|_. Hosts |_. Type |
[%
	for (adapter : InterfaceAdapter in self.focus.hosts){%]
| [%=adapter.name%] | [%=adapter.kind.name%] |
[%	}
	}
}

operation help!DocElement write(object : logic!Wizard){%]
h2.[%=self.focus.kind.name%] [%=self.focus.name%]
[%}

%]


But that produced an error, saying "Type 'architecture!InterfacePart' not found." Strangely, when I removed the namespace prefix, that error went away.

operation help!DocElement write(focus : InterfacePart){%]


However, this trick only worked for one of the domains. When I got an error saying, "Type 'logic!Method' not found," removing the prefix just resulted in, "Type 'Method' not found."

operation help!DocElement write(object : Wizard){%]


Next, I tried messing around with the Ant target I was using to call the generator. At first I had this, with no reference to either the 'architecture' or 'logic' metamodels:

<target name="GenerateDocumentation" description="" >
	<property name="helpModelFile"  value="design/EpsilonTools.help" />
	<epsilon.emf.loadModel	name="helpModel"
		modelfile="${helpModelFile}"
		metamodeluri="http://www.golemware.net/epsilontools/help/1.0"
		read="true" store="false"/>
	<epsilon.egl src="design/generators/GenerateDocumentation.egl">
		<model ref="helpModel" as="inputHelp" alias="help"/>
	</epsilon.egl>
	<epsilon.disposeModels/>
</target>


So then I changed the build file to this, in an attempt to insure explicit loading of the 'logic' metamodel. But it brought no improvement:

<target name="GenerateDocumentation" description="" >
	<property name="logicModelFile" value="design/EpsilonTools.logic"/>
	<property name="helpModelFile"  value="design/EpsilonTools.help" />
	<epsilon.emf.loadModel name="logic" 
		modelfile="${logicModelFile}"
		metamodeluri="http://www.golemware.net/epsilontools/logic/1.0"
		read="true" store="false"/>
	<epsilon.emf.loadModel	name="helpModel"
		modelfile="${helpModelFile}"
		metamodeluri="http://www.golemware.net/epsilontools/help/1.0"
		read="true" store="false"/>
	<epsilon.egl src="design/generators/GenerateDocumentation.egl">
		<model ref="logic" as="logic" alias="logic"/>
		<model ref="helpModel" as="inputHelp" alias="help"/>
	</epsilon.egl>
	<epsilon.disposeModels/>
</target>


I earlier had a similar problem with defining operations in an ETL file. There, I was able to resolve the issue by selectively removing the namespace prefixes.

The larger problem this bug illustrates is, I don't really feel like I understand how the meta-model registry and model loading mechanisms work. I've read the documentation I can find, but I remain confused, and my toy is sadly broken.

Any insights or advice would be much appreciated.
Re: Problem loading referenced types [message #529381 is a reply to message #529380] Sat, 24 April 2010 10:31 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Mark,

Could you please send me a minimal example (metamodels + sample models +
ETL/ETL transformations + ANT launcher) that reproduces this at
dskolovos_gmail_com so that I can have a closer look?

Cheers,
Dimitris

Mark Tippetts wrote:
> I'm trying to run the following EGL module. I've tried this using both
> Ant and a launch configuration, with the same results. It almost works.
>
> Basically, what I'm working on is yet another API documentation generator.
> GenerateTextile.egl defines part of a strategy for documenting an
> Eclipse product or feature, based on logical and architectural models of
> the feature. This template is called from a dispatcher,
> GenerateDocumentation.egl, which also calls on modules that create
> cheatsheets, a help context registry and toc files. Those work well enough.
> The purpose of this final sub-module is to create input to the Mylyn
> WikiText editor, using Textile syntax (Foo*.textile). The implementation
> serializes a graph of nodes and links by choosing a template snippet,
> based on the class of the object described by the node or link.
> The input file, Foo.help, references two other models, Foo.arch and
> Foo.logic. Each of these models is based on a different metamodel.
> That's the root of the trouble.
>
> Originally, I tried this.
>
>
> [% root.println('Processing ');
> if (root.focus.isDefined()){
> root.write(root.focus);
> }
>
> operation help!DocElement write(focus : architecture!InterfacePart){%]
> h1.[%=self.focus.kind.name%] [%=self.name%]
> [%
> if (self.text.isDefined()){%]
> [%=self.text%]
> [% }
>
> if (self.focus.hosts.isDefined()){%]
> |_. Hosts |_. Type |
> [%
> for (adapter : InterfaceAdapter in self.focus.hosts){%]
> | [%=adapter.name%] | [%=adapter.kind.name%] |
> [% }
> }
> }
>
> operation help!DocElement write(object : logic!Wizard){%]
> h2.[%=self.focus.kind.name%] [%=self.focus.name%]
> [%}
>
> %]
>
>
> But that produced an error, saying "Type 'architecture!InterfacePart'
> not found." Strangely, when I removed the namespace prefix, that error
> went away.
>
>
> operation help!DocElement write(focus : InterfacePart){%]
>
>
> However, this trick only worked for one of the domains. When I got an
> error saying, "Type 'logic!Method' not found," removing the prefix just
> resulted in, "Type 'Method' not found."
>
>
> operation help!DocElement write(object : Wizard){%]
>
>
> Next, I tried messing around with the Ant target I was using to call the
> generator. At first I had this, with no reference to either the
> 'architecture' or 'logic' metamodels:
>
>
> <target name="GenerateDocumentation" description="" >
> <property name="helpModelFile" value="design/EpsilonTools.help" />
> <epsilon.emf.loadModel name="helpModel"
> modelfile="${helpModelFile}"
> metamodeluri="http://www.golemware.net/epsilontools/help/1.0"
> read="true" store="false"/>
> <epsilon.egl src="design/generators/GenerateDocumentation.egl">
> <model ref="helpModel" as="inputHelp" alias="help"/>
> </epsilon.egl>
> <epsilon.disposeModels/>
> </target>
>
>
> So then I changed the build file to this, in an attempt to insure
> explicit loading of the 'logic' metamodel. But it brought no improvement:
>
> <target name="GenerateDocumentation" description="" >
> <property name="logicModelFile" value="design/EpsilonTools.logic"/>
> <property name="helpModelFile" value="design/EpsilonTools.help" />
> <epsilon.emf.loadModel name="logic"
> modelfile="${logicModelFile}"
> metamodeluri="http://www.golemware.net/epsilontools/logic/1.0"
> read="true" store="false"/>
> <epsilon.emf.loadModel name="helpModel"
> modelfile="${helpModelFile}"
> metamodeluri="http://www.golemware.net/epsilontools/help/1.0"
> read="true" store="false"/>
> <epsilon.egl src="design/generators/GenerateDocumentation.egl">
> <model ref="logic" as="logic" alias="logic"/>
> <model ref="helpModel" as="inputHelp" alias="help"/>
> </epsilon.egl>
> <epsilon.disposeModels/>
> </target>
>
>
> I earlier had a similar problem with defining operations in an ETL file.
> There, I was able to resolve the issue by selectively removing the
> namespace prefixes.
> The larger problem this bug illustrates is, I don't really feel like I
> understand how the meta-model registry and model loading mechanisms
> work. I've read the documentation I can find, but I remain confused, and
> my toy is sadly broken.
>
> Any insights or advice would be much appreciated.
>
Previous Topic:Validation Report
Next Topic:Problem loading referenced types
Goto Forum:
  


Current Time: Fri Apr 19 23:55:46 GMT 2024

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

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

Back to the top