|
|
|
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 |
Fábio Guarita 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 |
Fábio Guarita 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
|
|
|
Powered by
FUDForum. Page generated in 0.78608 seconds