Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Polarsys » M2Doc » AQL query works on Sirius interpreter, returns error on M2DOC
AQL query works on Sirius interpreter, returns error on M2DOC [message #1822356] Wed, 04 March 2020 20:09 Go to next message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
The query below:

aql:self.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange)

returns the following items on Sirius interpreter:

index.php/fa/37508/0/

When I use a similar construction on M2Doc the generated doc returns the following error:

Template:

{m:for ce | mySystemEngineering.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange)}
{m:endfor}

Results:
Invalid for statement: Expression "mySystemEngineering.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange)" is invalid: invalid type literal fa::ComponentExchange

How is that possible?

(thanks in advance for any light on this)

Re: AQL query works on Sirius interpreter, returns error on M2DOC [message #1822371 is a reply to message #1822356] Thu, 05 March 2020 07:35 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
You need to add the needed metamodels to your template (see the documentation and the nsURI tab). Use the add button and select *capella*.

If you are using the last version of M2Doc extensions for Capella 1.4.0. You can simply select the Capella token on the first tab.
Re: AQL query works on Sirius interpreter, returns error on M2DOC [message #1822386 is a reply to message #1822371] Thu, 05 March 2020 12:31 Go to previous messageGo to next message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
Thanks Yvan! That solved the issue!
Re: AQL query works on Sirius interpreter, returns error on M2DOC [message #1823031 is a reply to message #1822386] Wed, 18 March 2020 12:15 Go to previous messageGo to next message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
I had another example that wasn't fixed by adding the Capella component on the template editor. What could be the problem?

Sirius interpreter:

aql:self.eAllContents(fa::ComponentExchange).source.orientation

List of Orientations of all ports in the ComponentExchanges (IN, OUT and INOUT)

My Template file:

{ m:for ce | self.eAllContents(fa::ComponentExchange) }

Component Exchange: { m:ce.name }

Source: { m:ce.source.eContainer().name }

Target: { m:ce.target.eContainer().name }

Orientation: { m:ce.source.orientation }

{ m:endfor }

Generated docx file:

Orientation: { m:ce.source.orientation } Invalid query statement: Feature orientation not found in EClass InformationsExchanger



When I use the Sirius interpreter in Capella I am able to access the ComponentExchange port and its orientation. In M2DOC it says the 'feature orientation not found in EClass InformationExchanger'. I thought the ce.source (or self.eAllContents(fa::ComponentExchange).source) was of the type ComponentPort (so I could access the 'orientation' feature in it) but M2Doc says it is an EClass InformationExchanger...

What am I missing here?

[Updated on: Wed, 18 March 2020 13:49]

Report message to a moderator

Re: AQL query works on Sirius interpreter, returns error on M2DOC [message #1823050 is a reply to message #1823031] Wed, 18 March 2020 20:30 Go to previous message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
I found the solution by myself. I'll share here for future reference:

It seems the problem was the type returned by "ce.source" was something more generic than the ComponentPort (which has the orientation feature).

I just added a cast (or typed it) as fa::ComponentPort using "oclAsType()" and then I was able to call the "orientation" feature.

ce.source.oclAsType(fa::ComponentPort).orientation

ce is a variable containing a component exchange: for ce | self.eAllContens(fa::ComponentExchange)

Not sure if that is the real reason but that was how I reasoned about it.

[Updated on: Wed, 18 March 2020 20:33]

Report message to a moderator

Previous Topic:Multi-column tables in M2Doc
Next Topic:M2Doc and PVMT extension
Goto Forum:
  


Current Time: Mon Dec 05 19:30:00 GMT 2022

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

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

Back to the top