Writing an Import Converter
This is the reverse process of the Export operation.
2. Create a new converter file with name “ImportWTChangeRequest2.inn” and place it under <WINDCHILL_HOME>/codebase/registry/stepdex/ap214/importxpx/includes” directory
3. Add mapping for the object and attributes in inn file created in Step 2.
◦ Map Versioned_Action_Request entity AP214 Schema to WTChangeRequest2 entity in Windchill Schema
◦ Invoke updateRootTag function and pass the Windchill entity name. (This helps in identifying list objects to be imported.)
◦ Map Id attribute in Versioned_Action_Request to its counterpart r_number attribute associated with WTChangeRequest2 entity.
Following figure depicts how to map these attributes
(*
Maps versioned_action_request to e_WTChangeRequest2.
*)
MAP xpxmChange FOR wtChange:wnc::e_WTChangeRequest2;
FROM (ver_act:aim::versioned_action_request)
WHEN TRUE;
BEGIN_MAP
LOCAL
--Local variables
END_LOCAL
-- Update roor tag in importList.
updateRootTag('e_WTChangeRequest2;);
wt_change.r_number := ver_act.id;
END MAP;
4. Register/Include the converter file in the export-specific project file (AP214TOWNC.xpxprj) as shown in the code below.
(*
XPX Project file for AP214 to Windchill import mapping. This should contain source?_files definition one Main file followed by all includes files source.
*)
SOURCE FILES
"AP214TOWNC.xpx" --Main file
"includes/ImportWTPart.inn"
"includes/ImportWTDocument.inn"
"includes/ImportEPMDocument.inn"
"includes/ImportWTChangeRequest2.inn"
"includes/ImportHandlePropertyDefinition.inn"
"includes/ProcessAppliedDocumentReference.inn"
"includes/ImportRepresentation.inn"
"includes/ImportWTPartUsageLink.inn"
"includes/ImportWTPartDescribeLink.inn"
"includes/ImportWTPartReferenceLink.inn"
"includes/ImportEPMMemberLink.inn"
"includes/ImportEPMDescribeLink.inn"
"includes/ImportEPMReferenceLink.inn"
"includes/ImportContentItem.inn"
"includes/ImportGlobalFunctions.inn"
"includes/ImportOrganization.inn"
"includes/ImportBusinessFields.inn"
"includes/ImportUnitUtils.inn"
"./../../common/includes/StringUtils.inn"
"./../../common/includes/AggregateUtils.inn"
"./../../common/includes/DateTimeUtil.inn"
"./../../common/includes/import/ImportUtil.inn"
"./../../common/includes/import/ImportWTPartAttributes.inn"
"./../../common/includes/import/ImportVersionObject.inn"
"./../../common/includes/import/ImportLifeCycleObject.inn"
"./../../common/includes/import/ImportBusinessFields.inn"
"./../../common/includes/import/ImportContentItemAttributes.inn"
"./../../common/includes/import/ImportWTDocumentAttributes.inn"
"./../../common/includes/import/ImportWTPartDescribeLink.inn"
"./../../common/includes/import/ImportRepresentation.inn"
END_SOURCE_FILES