Writing an Import Converter
This is the reverse process of the Export operation.
1. Understand how entity or attributes in Automotive Design (AP214) Schema is mapped to Windchill Schema.
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"
"./../ includes/StringUtils.inn"
"./../ includes/AggregateUtils.inn"
"./../ includes/DateTimeUtil.inn"
"./../ includes/import/ImportUtil.inn"
"./../ includes/import/ImportWTPartAttributes.inn"
"./../ includes/import/ImportVersionObject.inn"
"./../ includes/import/ImportLifeCycleObject.inn"
"./../ includes/import/ImportBusinessFields.inn"
"./../ includes/import/ImportContentItemAttributes.inn"
"./../ includes/import/ImportWTDocumentAttributes.inn"
"./../ includes/import/ImportWTPartDescribeLink.inn"
"./../ includes/import/ImportRepresentation.inn"
END_SOURCE_FILES