Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » allSubobjectsOfType works with some types.
allSubobjectsOfType works with some types. [message #1837491] Mon, 01 February 2021 03:10 Go to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
Hello,

I am using a KDM instance and I create some queries.

When I use this code:


self.allSubobjectsOfType(code::CodeElement) -> forEach(r){
			
			r.codeRelation[Extends] -> forEach(q){
					
				log("Extends: "+q._from.name + " -> " + q.getTo().name)
			}
	}



The ouput is empty. The problem is that the function does not get types of code::CodeElement, and I dont know why, because it works with other types, for instance MethodUnit, StorableUnit and others.

The xmi is too big to attached it.

Thanks,

Daniel.
Re: allSubobjectsOfType works with some types. [message #1837499 is a reply to message #1837491] Mon, 01 February 2021 08:15 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 115
Registered: April 2011
Senior Member
Hi

Could you please attach the full QVTo project?

Daniel San Martín wrote on Sun, 31 January 2021 22:10

The xmi is too big to attached it.

Please create a minimal version that demonstrates the problem. Otherwise it will be really hard to find out what goes wrong.


Kind regards
Christopher
Re: allSubobjectsOfType works with some types. [message #1837501 is a reply to message #1837499] Mon, 01 February 2021 09:36 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Are you sure that you did not mean allSubobjectsOfKind? looks like the same gotcha whereby oclIsType is almost plays a bug. Ditto in Java; xx.getClass() == XX.class rather than xx instanceof XX.

Are you sure that [Extends] is not filtering out all possibilities?

Regards

Ed Willink
Previous Topic:QVTo transformation from command line
Next Topic:QVTo apply stereotype
Goto Forum:
  


Current Time: Sat Apr 27 04:05:30 GMT 2024

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

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

Back to the top