Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo : Random output(Different outputs from the same input model)
Acceleo : Random output [message #530693] Fri, 30 April 2010 14:42 Go to next message
koita Aboubakar is currently offline koita AboubakarFriend
Messages: 11
Registered: April 2010
Junior Member

Hi,

I'm testing generation with acceleo ffrom two models correlated. The second model is the first including int the class references on associations.

A first template I programmed take the model without references, the first, and generates Java beans from it, in performing associations. It work very well.

A second template take the second models with references, and produces the same previous Java Beans, by processing references, instead of associations.
Here is the problem, this template produces some time the correct output, some time it produces only some files, that are incomplete.

But the same template work correctly all ways with the input model without references, the first. And the first template work correctly with the second model.

Some explications ?

Aboubakar
Re: Acceleo : Random output [message #530750 is a reply to message #530693] Fri, 30 April 2010 17:06 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030206020504040409090803
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Without seeing either model or template, I can only assume.

"random" output often means that you use "Set" or "Bag" as your
collections in OCL (they'll be created under the hood if either of your
references is multi valued (upperBound = -1) and unordered (order =
false). If these two conditions are met, you'll get a Set or a Bag
depending on the "unique" property of your reference (if unique = false,
you'll get a Bag, otherwise a Set). Neither of these is ordered, thus
your iteration order is random, and you get random output.

Another possibility would be that your "references on associations"
aren't resolved, which would lead EMF to create unresolved proxies. This
would explain your incomplete files. That can happen if you use a
metamodel that requires extra setup before it can be used. An example
would be UML ( see
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
). You can take care of these extra steps in the java class we generate
to launch your generation module (it is generated just beside the
module, with the same name).

A third possibility would be that you get exceptions when trying to
generate. Please take a look at your error log (Window => show view =>
error log) in order to determine this.

I cannot give a more detailed answer with this little information. Does
any of this help?

Laurent Goubet
Obeo

koïta Aboubakar wrote:
>
> Hi,
>
> I'm testing generation with acceleo ffrom two models correlated. The
> second model is the first including int the class references on
> associations.
> A first template I programmed take the model without references, the
> first, and generates Java beans from it, in performing associations. It
> work very well.
>
> A second template take the second models with references, and produces
> the same previous Java Beans, by processing references, instead of
> associations.
> Here is the problem, this template produces some time the correct
> output, some time it produces only some files, that are incomplete.
> But the same template work correctly all ways with the input model
> without references, the first. And the first template work correctly
> with the second model.
>
> Some explications ?
>
> Aboubakar
>


--------------030206020504040409090803
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030206020504040409090803--
Re: Acceleo : Random output [message #667306 is a reply to message #530750] Wed, 27 April 2011 23:07 Go to previous message
radwane  is currently offline radwane Friend
Messages: 27
Registered: April 2011
Junior Member
Aboubakar hi
how u can run ur generate file??
Previous Topic:How to remove fully qualified names to imports
Next Topic:[ACCELEO] how to generate java code??
Goto Forum:
  


Current Time: Fri Apr 19 03:11:01 GMT 2024

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

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

Back to the top