[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2m] Re: [QVTO] Question about intermediate properties
|
Hi Toñi ,
Some replies are in-lined, below
Regards,
Sergey
Toñi Reina Quintero wrote:
Hello everybody,
Although I have said in the subject the question is about
intermediate properties, I'm not sure if it has to do with them or with
OrderedSet assignments.
I have defined a intermediate property called nodesMainNav. This
property is an Ordered Set of Nodes.
In the transformation entry point I'm trying to fill in the
Ordered Set. For that, I executed a query named getMainNavigationArea,
that returns an Area, and as an Area is composed of a set of Nodes, I
use the relation nodes to extract all the nodes of the area. As it can
be seen in the piece of code I show below.
intermediate property siteMap::nodesMainNav : OrderedSet(siteMap::Node);
main() {
inModel.nodesMainNav := getMainNavigationArea().nodes;
log('1..Num nodos',inModel.nodesMainNav->size());
inModel.rootObjects()[siteMap::Sitemap]->map toWebSite();
}
As far as I understand you've defined property 'nodesMainNav' on
modeltype 'siteMap'.
I presume that transformation your signature looks like:
transformation NewTransformation(in inModel : siteMap);
Actually it's not legal to define intermediate property on modeltypes.
Current qvto version (2.0.0) prohibits that.
In case you need global property you might define it like follows:
property nodesMainNav : OrderedSet(EClass) = OrderedSet{};
In case that doesn't help we'll go farther with the example code.
However I don't see any issues with assignment itself.
As I answered your posts in amalgam newsgroup I saw that you use old
1.0.1 version. I suggest you to start using 2.0.0 release.
My problem is that the log sentence that appears as '1..Num nodos' shows
the number of nodes in the OrderedSet is 0. However, I have written a
similar log sentence inside the getMainNavigationArea query, and the
result is that there are 8 nodes in the Area.
My question is: why does the OrderedSet seem to be without any nodes
outside the query? Is this related to the intermediate property or is
something related to the assignment?
Best regards,
Toñi