|
Re: [Acceleo] A circular dependency exists between scripts [message #985798 is a reply to message #985676] |
Fri, 16 November 2012 08:38 |
|
Hi Dario,
Sounds like an awfully complicated design to me. It seems like you are trying to parse a language and transform it into another?
Whatever the reason Acceleo will not allow circular dependencies because of compilation issues. Why are you creating "modules" where it seems like templates would be much more of a fit? If you have a model that contains concepts of "For", "If", "While" which represent statements, then surely you also have the concepts representing the artifacts of the language (Class, Package... There should be one in that language ). Your generator should not have one module per metamodel concept, doing so usually yields an unfathomable soup which will give a headache to the maintainer .
In such a case, you could have one single module holding all "statement" templates, which would be called by the 'higher level' modules : a module to "generate a Class" that will call the templates to generate the 'if's and 'for's it contains for example.
Well the main point is : if you find yourself in a case where you reach a cyclic dependency, your generators probably got too complicated. Since Acceleo will not allow cycles, you have to think about the architecture and find a way to simplify the design. I don't know if my above example helps in your case, but I hope you get the idea.
Laurent Goubet
Obeo
|
|
|
Re: [Acceleo] A circular dependency exists between scripts [message #985865 is a reply to message #985798] |
Fri, 16 November 2012 13:29 |
Dario Imparato Messages: 20 Registered: August 2012 |
Junior Member |
|
|
Laurent Goubet wrote on Fri, 16 November 2012 03:38Hi Dario,
Sounds like an awfully complicated design to me. It seems like you are trying to parse a language and transform it into another?
Whatever the reason Acceleo will not allow circular dependencies because of compilation issues. Why are you creating "modules" where it seems like templates would be much more of a fit? If you have a model that contains concepts of "For", "If", "While" which represent statements, then surely you also have the concepts representing the artifacts of the language (Class, Package... There should be one in that language ). Your generator should not have one module per metamodel concept, doing so usually yields an unfathomable soup which will give a headache to the maintainer .
In such a case, you could have one single module holding all "statement" templates, which would be called by the 'higher level' modules : a module to "generate a Class" that will call the templates to generate the 'if's and 'for's it contains for example.
Well the main point is : if you find yourself in a case where you reach a cyclic dependency, your generators probably got too complicated. Since Acceleo will not allow cycles, you have to think about the architecture and find a way to simplify the design. I don't know if my above example helps in your case, but I hope you get the idea.
Laurent Goubet
Obeo
Hi Laurent,
thank you very much, I followed your suggestion and solved circular dependencies.
Now I have another issue. When I try to launch the transformation as "Acceleo Application" in Eclipse-Juno (Runner:Acceleo Plug-in Application) I have the following error:
"An internal error occurred during:"Launching Acceleo Main". The type of the first parameter of the main template named "Main_script" is a proxy".
I have this error ONLY if the "Java Project" of the metamodel is closed, if I open it everything goes fine.
I obviously have added the JARs of the metamodel in the Java Build Path of the "Acceleo Project".
Do you have a solution also for this?
Thanks again.
Dario
|
|
|
Re: [Acceleo] A circular dependency exists between scripts [message #986872 is a reply to message #985865] |
Thu, 22 November 2012 08:04 |
|
Dario,
Something being 'a proxy' means that there is an unresolved reference in your model. If you try and open your template with the 'other project' closed, you will see that it contains a compilation error. (If not, then you only need to re-save it before launching the generation : the problem lies in the URIs between the template and the metamodel.)
Basically, the metamodel needs to be accessible in order for Acceleo to manage the generation.
Laurent Goubet
Obeo
|
|
|
|
|
|
Re: [Acceleo] A circular dependency exists between scripts [message #987828 is a reply to message #987577] |
Wed, 28 November 2012 10:24 |
Dario Imparato Messages: 20 Registered: August 2012 |
Junior Member |
|
|
Stephane Begaudeau wrote on Tue, 27 November 2012 03:47Hi Dario,
When you go in the Acceleo compiler properties of your Acceleo project (Alt+enter on the project and the navigate to the Acceleo properties), what kind of serialization are you using?
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Hello Stephane,
I am using XMI serialization and (if it is of interest) with "Compilation Path Kind" set to "Absolute file system paths".
Is it right?
P.S.
my metamodel was structured in one package containing 4 packages. I read in another thread that is not recommended to use nested packages, so I put all the metamodel in the root package. Unfortunately, I have not solved my problem.
[Updated on: Wed, 28 November 2012 14:40] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05046 seconds