[RESOLVED] - Capella / M2Doc - Howto export the value of a "String Property Value"

Hi,
I’m somehow new to Capella & M2Doc, so sorry if my question is stupid, but …
I have a Capella model that includes a “String Property Value” object, the name is ‘m:var:foo’, the value is ‘bar’. I wish to export the value ‘bar’ in a MS-Word document using M2Doc.
In my .docx template, I’ve added the variable ‘foo’. In my word document, after generation, the field {DOCPROPERTY m:var:foo * MERGEFORMAT} is replaced by ‘capellacore::StringPropertyValue’, which is indeed the type of the variable foo, but not the value. Getting the type seems consistent with the M2Doc documentation, but this does fit to my need, and my question is, how can I get the value ‘bar’ instead of the type ‘capellacore::StringPropertyValue’ in my document ?
Thanks for your help or advice,
Best regards,
Bernard

Hello Bernard,
I guess something like “foo.value” should do the work.
Can you try it?

Hi Aurélien,
Thanks for the quick reply.
Actually I did several tests. This is was I put in the template, and the result I get after generation:
{m:var:foo} => Invalid query statement: Expression “var:foo” is invalid: invalid type literal var:
{m:var:foo.value} => Invalid query statement: Expression “var:foo.value” is invalid: invalid type literal
{m:foo.value} => Couldn’t find the ‘foo’ variable
Couldn’t find the ‘aqlFeatureAccess(org.eclipse.acceleo.query.runtime.impl.Not hing,java.lang.String)’ service
{foo.value} => nothing is generenrated
{DOCPROPERTY m:var:foo.value} => Error! Unknown document property name.
{DOCPROPERTY m:var:foo} => capellacore::StringPropertyValue
Btw, I’m using Capella 1.2.1 and the corresponding M2Doc package (downloaded from Polarsys site).
Any suggestion ? I’m convinced that my mistake is certainly obvious, but I just can’t find it out
Bernard

Hello again,
So I’ve done the test on my side and it works fine.
What I do is:
1- Define the String Property Value in Capella
2 - Write the query in your M2Doc template using word
3 - declare the variable in the template using the M2Doc Template Editor
4 - Map the variable to the model element in the genconf file
5 - run the generation and get the result

Hello,
Ok, it works now! My problem was with the mapping in the genconf file (step #4 of your tutorial), which was not correct.
Many thanks / enjoy the WE,
Bernard