|
|
|
Re: [Acceleo] Use of template result in Sequence of String [message #545517 is a reply to message #545415] |
Thu, 08 July 2010 07:22 |
|
This is a multi-part message in MIME format.
--------------030602090606080200040506
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Sebastien,
You could use the post attribute on template aBlock() to force it in
returning a String (see below), but I don't know if this will help.
We're currently looking into it in order to understand why we end up
with a Sequence of Properties where it should be a Sequence of String.
[template x(a : Type) post(toString())/]
Laurent Goubet
Obeo
Sebastien Roy wrote:
> Thank you Edward for your answer.
>
> However, my actual code is a little more complicated than the sample I
> wrote above.
> Actually it would be very tedious to write the actual code of 'aBlock'
> as a query. Furthermore, there is several different templates that may
> be implied in the sequence construction.
>
> So my initial question becomes :
>
> Is there a way to transform a template result (i.e a Property) into a
> String ?
>
> Sebastien
--------------030602090606080200040506
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=
--------------030602090606080200040506--
|
|
|
|
|
|
|
Re: [Acceleo] Use of template result in Sequence of String [message #631500 is a reply to message #545350] |
Thu, 07 October 2010 18:12 |
|
Well Sebastien I have a good news for you.
While taking the bus tonight I thought about this bug once again and I had an idea. Since the first time I tried to solve the problem I didn't find where it was coming from, tonight at home, I tried my idea to see if it was the source of the bug and guess what ? I know where the bug is coming from.
When parsing the module we identify the template call as an (OCL) OperationCallExp and then we convert it to our TemplateInvocation (same thing for queries) but we didn't convert the parameters of the template or the query. Thus if you have a call (template or query) as a parameter like:
[myTemplate(Sequence{myQuery(myValue)})/]
The call of myQuery was still an OperationCallExp and OCL could not resolve that call correctly. So while the diner was in the oven, I went back to this bug and created a fix that you can see here in action:
The fix may not take into account all form of parameters right now but it will work on a collection of template or query invocations. I'm not sure for example that it would work on this:
[myTemplate(Sequence{Sequence{myQuery(myValue)}})/]
But now I know:
- why it is not working
- where the bug is coming from
- and how to solve the problem
So I will upload this temporary fix on the bugzilla for today and I will get back to this problem a bit later but a patch correcting the problem will be available in Acceleo 3.0.2 (SR2 in February) and in Acceleo 3.1.0 (M3 next month).
Have a great day
Stephane Begaudeau, Obeo
|
|
|
|
Powered by
FUDForum. Page generated in 0.05122 seconds