Error while generating A UML code [message #1785102] |
Mon, 09 April 2018 09:45  |
Eclipse User |
|
|
|
Good morning,
I've been trying to generate a .qml code from a model, I'm almost close to doing it but there is this error that I dnt knw how to fix it, u'll find below my code :
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/5.0.0/UML', 'http://www.eclipse.org/papyrus/sysml/1.4/SysML', 'http://www.eclipse.org/papyrus/sysml/1.4/SysML/Blocks')]
[template public generate(m : Model)]
[comment @main/]
[file (m.name + '.qml', false, 'UTF-8')]
[for (b:uml::Class|m.eAllContents())]
[if(b.hasStereotype('Block'))]
[GenerateClass(b)/]
[/if]
[/for]
[/file]
[/template]
[template public GenerateClass(b:uml::Class)]
import QtQuick 2.2
[b.name/]
{
[allAttributes(b)/]
}
[/template]
[template public allAttributes(b:uml::Class)]
[for (a :uml::Property|b.getAllAttributes())]
[if(not a.oclIsKindOf(Port))]
[a.type.name/] [a.name/];
[/if]
[/for]
[/template]
[query public hasStereotype (e:uml ::Element, value :String) : Boolean
= not e.getAppliedStereotypes()->select(e:uml ::Stereotype |e.name =value )-> isEmpty()
/]
and this is the error :
org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid type for iteration at line 8 in Module generate for block for (m.eAllContents()). org.eclipse.uml2.uml.internal.impl.PackageImportImpl was not an instanceof Class.
at generate.generate(Model)(generate.mtl:8)
at generate.generate(Model)(generate.mtl:7)
at generate.generate(Model)(generate.mtl:5)
I'm using eclipse oxygen 3 and my model is created with papyrusand is composed of 2 blocks connected with a composite association(directed)
Thank u ^^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05533 seconds