Advanced Customization > Services and Infrastructure Customization > Import Export Framework > How to Write Exp/Imp Handlers > How to Write a Class (Element) Import Handler > Handler for Versioned Object
  
Handler for Versioned Object
1. Create a Java class that extends ExpImpVersionedObject
2. Implement the following methods:
public List<IxbHndHelper.ElementObjectPair> getMasters(Collection<IxbElement>, Importer, WTcontainerRef) : returns the list of ElementObjectPair if there is any version of the importing object/s in the database.
3. Override the following methods if necessary:
public Object importObjectsAttributes ( List<IxbHndHelper.ElementObjectPair>,
Importer importer);
public Object importObjectsAttributesAfterStore(
List<IxbHndHelper.ElementObjectPair>,
Importer importer);
public Object findAmongExistingObjectsInternal (
IxbElement fileXML,,Importer importer);
* 
An object is imported by the following sequence: createObject(), importObjectAttributes(), storeObjects(), importObjectAttributesAfterStore().
createObject()
This method is implemented in the class ExpImpForVersionedObject. The creation of objects will be delegated to Actor classes, depends on the actor name in the XML file (The actor name is writen into the XML file by import application). Particular object handlers don’t have to worry about createObject() and Actor.
importObjectAttributes()
Import all attributes of the object that can be imported before the object is stored.
storeObject()
This method is implemented in the class ExpImpForVersionedObject. The store of objects will be delegated to Actor classes, depends on the actor name in the XML file (The actor name is writen into the XML file by import application). Particular object handlers don’t have to worry about storeObject() and Actor.
importObjectAttributesAfterStore()
Import all attributes of the object that must be imported after the object is stored
ExpImpForWTPart, ExpImpForDocument, ExpImpForEPMDocument are examples of import handlers for versioned objects.
4. Add an entry to the handlers registry file (<Windchill>\registry\ixb\handlers\coreX10.xml). The entry specifies the class being imported (MyObject), XML DTD for core Windchill objects (standardX20.dtd ), and the handler for the class com.ptc.mypackage.ExpImpForMyObject. An example entry follows:
<elementImporter>
<tag>MyObject</tag>
<dtd>standardX20.dtd</dtd>
<handler>com.ptc.mypackage.ExpImpForMyObject</handler>
</ elementImporter >