These are the best practices you should follow when performing certain Autodesk Vault Data Transfer Utility workflows.
Validation
There are three methods for validating a data transfer:
- Use Visual Studio to validate XML against provided XSD files. IntelliSense highlights issues.
- Programmatically validate a data transfer. See XMLReaderSettings.ValidationType for more information.
- Use the VALIDATE option with VaultBCP. This option can be used to catch XSD level errors such as incorrect attribute names.
This option takes less time than the IMPORT option to execute since there are no server API calls or database calls, and no
files are copied.
Using IterationRef
The IterationRef element is used to reference files which are already in Vault.
Follow these steps to reference files already in Vault.
- Create an IterationRef element for each file version that is already in Vault.
Make sure that Checksum and CreateDate have correct values. Vault uses CRC32 for file checksum.
- If the file has multiple versions, make sure that those versions are in the correct order.
Remarque
The value of the Id attribute can be anything but it must be unique.
- Make sure to put an underscore in front of the value.
- When referencing a file iteration in another element, the IterationRef value must match the referenced value.
RemarqueWhile in Vault 2013, leading underscores were eliminated, this is no longer necessary as of Vault 2014.
- The iterations must be in the correct order.
Any errors will result in a warning message during import.
WARNING: Cannot locate a historical version of file 'Pad Lock.iam' due to changes to the vaulted file. Skipping...
Partition Data
You can also split XML into smaller chunks. Here is one suggested method:
- 1st Pass–import all files which do not have references to other files (i.e., IPT files). If there is a large amount of files, it is
possible to split them into smaller files.
- 2nd Pass–import files with file associations. Use IterationRef to reference files which are already in Vault from previous steps.
- 3rd Pass–import items. Use IterationRef to reference files which are already in Vault.
Import Updates
You can import file and item updates using the Autodesk Vault Data Transfer Utility.
File Updates
When importing new file updates it's necessary to include all previous iterations of that file in the package. It isn't possible
to alter existing file iterations which are already in the Vault.
Sample
Iteration 1–Import the file.
- Create a File element with all required values.
- Create a Revision element with all required values.
- Create an Iteration element for all required values. Make sure Id attribute has a unique value.
This iteration creates a new file in Vault with one version only.
Iteration 2–Update content and properties.
- Use the elements from Iteration 1. Do not change information inside the elements. Those changes will not be imported.
- Create an Iteration element below the existing element. Add a path to the new file and other values. Make sure the Id attribute has a unique value.
- Add a new user-defined property element for the property.
A new version of the existing file is created.
Item Updates
When importing new item updates it's necessary to include all previous iterations of that file in the package. It isn't possible
to alter existing item iterations which are already in the Vault.
Sample
Iteration 1–Import the item without any properties.
- Create an ItemMaster element with all required values.
- Create an ItemNumber element with all required values.
- Create a Rev element with all required values.
- Create an Iteration element with all required values. The value of ItemNumberID attribute must match to ItemNumberID from ItemNumber element.
The new item is created with a single revision.
Iteration 2–Update the revision number and new properties.
- Use the elements from Iteration 1.
- Create a new Rev element below the existing Rev element. Add all required values. Make sure that RevOrder is incremented.
- Create a new Iteration element with all of the required values. Make sure that IterationNumber is incremented.
A new revision of the existing item is created.
File Associations
File associations are defined with the Association element.
All files (parents and children) are imported using the same package.
- Create an Association element inside an Iteration of the parent element.
- Set the ChildId value to the same value as the Id attribute of the child iteration.
- The RefId attribute contains the reference id of the associated file. This information is used by resolve process. The resolver process
starts automatically when a file is downloaded to the client and the NeedsResolution attribute is set to true. The reference id is specific for each document type, ( i.e., for Inventor files it can be obtained
via API). Usually file resolution is required only when files are renamed or moved to adifferent directory structure.
If the child file is already in the Vault then it's possible to use the IterationRef element as specified above.
Item Associations
The item structure (BOM) can be created using the bomLink element.
- Create a bomLink element for each child item. Add all required values.
- The ChildItemMasterID value should match the value of the ItemMasterId attribute of the associated item.
Item to File Associations
The links between items and files can be created using the DesignDoc element.
- Create a DesignDoc element. The value of the FileIterationId attribute must match the value of the Id attribute for file iteration (specified in Vault.xml).
Importing BOMs Linked to Previously Imported Items
You can import Bills of Materials (BOMS) that are linked to items which have already been imported using a different XML file.
- Create an itemToComp element.
- The value of the ItemIterationID attribute must match the ID of the ItemIteration that the BOM links to.
- The value of the sourceId attribute must match the sourceId of the XML file used to import the item. The XMLIDs must also match.
- The ChildItemMasterID value is the MasterID of the child in the BOM relationship.