Some API exist to manipulate objects from their unique identifier.
EObject object = xmlResource.getEObject(objectId);
String objectId = object.eResource().getURIFragment(object);
Our MagicDraw reader will read Start Object Behavior Action like a Start Classifer Behavior Action.
To keep the origin type, an EAnnotation is added to the Object created.
To recover the original type:
String xmiType = UMLAnnotationKey.getAnnotation((Element) object, UMLAnnotationKey.ELEMENT_XMI_TYPE); if ("StartObjectBehaviorAction".equals(xmiType)) { // this is a StartObjectBehaviorAction }
Managing Diagram
Writing Diagram Properties
MDAccess for UML API Reference
MDAccess for MagicDraw API Reference
DiagramProperties