Unknown type... that seems to bo known [message #516352] |
Tue, 23 February 2010 16:31 |
|
I keep getting this error:
"Unknown type 'ManagerGeneration::ManagerCollection'"
when I generate.
But this type it is recognized in the Xpand editor (auto-completion proposes it).
I use also other types created as ManagerCollection but I have no problem with them.
ManagerCollection it is an EMF Class created using a genmodel file,
what should I check first?
I have really no idea /keine ahnung...
Federico
website: http://www.federico-tomassetti.it
|
|
|
|
Re: Unknown type... that seems to bo known [message #516806 is a reply to message #516503] |
Thu, 25 February 2010 09:08 |
|
I use a WorkflowRunner
The Mwe file I use contains:
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".." />
The mwe file used to be in the package "workflows", then I moved it to the "it.tomassetti.fvcgen.workflows". Should I update platformUri=".." to platformUri="../../../.." ?
Have I to specifiy the single metamodels?
Until now I did not and it worked flawlessly...
thank you,
Federico
website: http://www.federico-tomassetti.it
|
|
|
|
Re: Unknown type... that seems to bo known [message #516843 is a reply to message #516839] |
Thu, 25 February 2010 10:47 |
|
<workflow>
<property name="verbose" value="false" />
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".">
</bean>
<!--<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${targetDir}"/>-->
<component class="it.tomassetti.mdwe.MultiDslMweReader">
<register class="it.tomassetti.fvcgen.FvcStackSimplDslStandaloneSetup"/>
<outputSlot value="fvcsModel" />
<srcDir value="${modelsDir}" />
<fileExtension value="fvcs" />
<verbose value="${verbose}" />
</component>
<component class="it.tomassetti.mdwe.MultiTargetSetterComponent">
<modelKey value="fvcsModel" />
<targetKey value="targetDirs" />
<verbose value="${verbose}" />
<defaultTargetDir value="${targetDir}" />
</component>
<component class="it.tomassetti.fvcgen.transformation.MultiDslModelToGenModelComponent">
<verbose value="${verbose}" />
<targetsSlot value="targetDirs" />
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="dataBeansModel" />
<expand value="template::BeanTemplate::main FOR dataBeansModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
<verbose value="${verbose}" />
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="modelBeansModel" />
<expand value="template::BeanTemplate::main FOR modelBeansModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
<verbose value="${verbose}" />
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="formBeansModel" />
<expand value="template::BeanTemplate::main FOR formBeansModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
<verbose value="${verbose}" />
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="businessComponentsModel" />
<expand value="template::BusinessComponentTemplate::mainWithoutConf FOR businessComponentsModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
<verbose value="${verbose}" />
</component>
<component class="it.tomassetti.mdwe.ListDericherWorkflowComponent">
<inputSlot value="businessComponentsModel"/>
<outputSlot value="businessComponentsModelDeriched"/>
</component>
<component class="it.tomassetti.mdwe.ListDericherWorkflowComponent">
<inputSlot value="servicesModel"/>
<outputSlot value="servicesModelDeriched"/>
</component>
<component class="it.tomassetti.mdwe.ListDericherWorkflowComponent">
<inputSlot value="controllersModel"/>
<outputSlot value="controllersModelDeriched"/>
</component>
<component class="it.tomassetti.mdwe.ListDericherWorkflowComponent">
<inputSlot value="managersModel"/>
<outputSlot value="managersModelDeriched"/>
</component>
<component class="org.eclipse.xpand2.Generator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<expand value="template::BusinessComponentTemplate::configuration FOR businessComponentsModelDeriched" />
<outlet path="${targetDir}" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
<postprocessor class="org.eclipse.xpand2.output.XmlBeautifier" />
</outlet>
<prSrcPaths value="${targetDir}"/>
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="servicesModel" />
<expand value="template::ServiceTemplate::mainWithoutConfiguration FOR servicesModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
<verbose value="${verbose}" />
</component>
<component class="org.eclipse.xpand2.Generator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<expand value="template::ServiceTemplate::configuration FOR servicesModelDeriched" />
<outlet path="${targetDir}" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
<postprocessor class="org.eclipse.xpand2.output.XmlBeautifier" />
</outlet>
<prSrcPaths value="${targetDir}"/>
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="ejbModel" />
<expand value="template::EjbTemplate::main('${ejbVersion}') FOR ejbModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="controllersModel" />
<expand value="template::ControllerTemplate::mainWithoutConfiguration FOR controllersModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="org.eclipse.xpand2.Generator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<expand value="template::ControllerTemplate::configuration FOR controllersModelDeriched" />
<outlet path="${targetDir}" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
<postprocessor class="org.eclipse.xpand2.output.XmlBeautifier" />
</outlet>
<prSrcPaths value="${targetDir}"/>
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="it.tomassetti.mdwe.MultiXpandMultiTargetGenerator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<inputSlot value="managersModel" />
<expand value="template::ManagerTemplate::main FOR managersModelItem" />
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
<component class="org.eclipse.xpand2.Generator">
<skipOnErrors value="true" />
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<fileEncoding value="ISO-8859-1"/>
<expand value="template::WebConfTemplate::main(controllersModelDeriched) FOR managersModelDeriched" />
<outlet path="${targetDir}" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
<postprocessor class="org.eclipse.xpand2.output.XmlBeautifier" />
</outlet>
<prSrcPaths value="${targetDir}"/>
<prDefaultExcludes value="false"/>
<prExcludes value=""/>
</component>
</workflow>
The problem arises with the last Generator.
If I specify the metamodels in this way:
<metaModel id="managers" class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="it.tomassetti.fvcgen.generation.ManagerGeneration.ManagerGenerationPackage"/>
</metaModel>
<metaModel id="controllers" class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="it.tomassetti.fvcgen.generation.ControllerGeneration.ControllerGenerationPackage"/>
</metaModel>
The problem diseappears. Notably in all the other Generator I need not to specify the single EMF package but I use the generic
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
Federico
NOTE; modelsDir, verbose and other properties are not present in the mwe file but are specied when the MWE file is invoked using WorkflowRunner
website: http://www.federico-tomassetti.it
[Updated on: Thu, 25 February 2010 10:48] Report message to a moderator
|
|
|
|
Re: Unknown type... that seems to bo known [message #516949 is a reply to message #516942] |
Thu, 25 February 2010 15:11 |
|
Well, I did nothing to explicitely insert them... but it worked.
It seems to me that they are insert automatically because for every Ecore model are generated the package interface:
public interface <MetaModelName>Package extends EPackage {
...
}
and this interface contains a field (implicitly static):
<MetaModelName>Package eINSTANCE = <<MetaModelName>PackageImpl.init();
And the method init register it:
public static BeanGenerationPackage init() {
if (isInited) return (BeanGenerationPackage)EPackage.Registry.INSTANCE.getEPackage(BeanGenerationPackage.eNS_URI);
// Obtain or create and register package
BeanGenerationPackageImpl theBeanGenerationPackage = (BeanGenerationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof BeanGenerationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new BeanGenerationPackageImpl());
isInited = true;
// Initialize simple dependencies
CommonPackage.eINSTANCE.eClass();
// Create package meta-data objects
theBeanGenerationPackage.createPackageContents();
// Initialize created meta-data
theBeanGenerationPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theBeanGenerationPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(BeanGenerationPackage.eNS_URI, theBeanGenerationPackage);
return theBeanGenerationPackage;
}
I try to imagine what happened....
Classes are loaded "lazily", for some reasons the other package interfaces are loaded and as conseguence the metamodel was registered without an explicit action from me. One of these metamodels is not registered because I did not use the related package, so it was not loaded and so it did not register it.
Probably I should call the init method explicitly during initialization...
Do you think is plausible what I wrote?
Federico
website: http://www.federico-tomassetti.it
|
|
|
|
Powered by
FUDForum. Page generated in 0.04848 seconds