Querying KDM model [message #984725] |
Wed, 14 November 2012 18:12  |
Eclipse User |
|
|
|
Hi,
I would like to do some querys with the KDM model generated programmatically.
//Get KDM Segment
Segment kdmSegment = (Segment) javaResource.getContents().get(0);
listKdmModel = kdmSegment.getModel();
//Get Models
kdmModel = listKdmModel.get(0);
For example, get all classes. Which tool is most appropriate to do that?. I was thinking in Quey2 or OCL. Do you have some examples?
Thanks,
Daniel.
|
|
|
|
|
|
|
Re: Querying KDM model [message #987175 is a reply to message #986382] |
Fri, 23 November 2012 21:50  |
Eclipse User |
|
|
|
Hello Hugo,
Thanks, now I understand how to do some queries but with a new doubt.
I am trying to do a query with JXPath. I would like to get the name of the classes (file attached), in this case it must be A, L and B.
The properties of a JXPath Model query are the following:
Scope: KDMModel, ModelElement, Element.
Query: //codeElement//@name
Return: EEList<E> [org.eclipse.emf.common.util.EList]
I think it must retrieve all the names of CodeElement type but I just get the first element, the name of the package "br". What am I doing wrong?
Thanks,
Daniel
|
|
|
Powered by
FUDForum. Page generated in 0.31645 seconds