Let’s say I have Person EMF Model. I create 2 instances of this model bob.person and mike.person. Is there way to create a collection of all models in my workspace that are Person and query them using OCL or EMF Query?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, definitely.
First, to create a collection of all models of some type in workspace use Eclipse Resources API.
will come handy, searching for files with specific extensions, and putting them into collection. They can be loaded into a resource set with:
Next, you should execute a Query against a result set. You can either collect all the root elements of a resource set with:
or create a
with similar functionality, to use with FROM EMF Model Query statement.