How to add an InstanceSpecification to a Package using org.eclipse.uml2 API

93 Views Asked by At

Here is a simple task for you who know the org.eclispe.uml2 API:

I'd like to add an org.eclipse.uml2.uml.InstanceSpecification to an org.eclipse.uml2.uml.Package, but how is that done?

Package package = model.createNestedPackage("MyInstancePackage");       
InstanceSpecification is = UMLFactory.eINSTANCE.createInstanceSpecification();
// package.someMethod(is) <--- ???

Thanks a lot!

1

There are 1 best solutions below

0
On

This was really easy as expected:

package.getPackagedElements().add(is);