| [news.eclipse.technology.epf] Re: Getting RoleSets from XMI files |
Quentin,
Comments below.
Try to avoid using Impl classes of the models. Using RoleDescriptor should be sufficient for all your purposes.Hi,
I can list all the roles from my EPF Composer model, I can also list all the tasks and phases, as well as the work products, etc.
But I can't find a way to get the RoleSets. I'd like to list the RoleSets and then get the Roles from them.
Here is an example of how I can list all the roles (and also the rolesets, but there's apparently no way to know whether it's a roleset or a role) :
Resource resource = resourceSet.getResource(fileURI,true); for (Iterator i = resource.getAllContents(); i.hasNext();) { Object o = i.next(); if (o instanceof RoleDescriptorImpl) {
I'm not sure how a RoleSet relates to a RoleDescriptor...RoleDescriptorImpl rdi = (RoleDescriptorImpl)o; System.out.println(" - Role : " + rdi.getPresentationName()); } }
And by the way, I get no "RoleSetImpl" from resource.getAllContents().
I know nothing about this model, but my guess would be that these things are contained in different resources while the above will only give you the direct contents of the first resource. There's probably a better way to get to them than by brute force, but I'd have to know the model structure to know that, and I don't. For a brute force approach, try resourceSet.getAllContents() to visit all the resources in the resource set.
I also have the same problem for Work Products and Work Product Types. I can list the Work Products but I can't have the Work Product Types.
Thanks in advance,
Quentin