The Package Service

The Package Service is harder to describe than the rest of the Vault web services.  It was designed with one thing in mind, but ended up doing something else.  As a result, there are some artifacts left around that make it confusing to work with.  The main use nowadays is to import and export BOM data between the Item service and a file.  But there is still some active legacy behavior that you might find useful.


File Import/Export:

The Package Service implements the Import and Export commands for Item BOM data.  You can find sample code in the ItemEditor example in the SDK.

The biggest confusion with import/export API is that the Package Service has its own BOM objects, which act as an intermediate between the Item Service BOM and the imported/exported file.  Another point of confusion is the fact that the words "import" and "export" don't show up in any of the API functions.  

For example, to export, you call PackageService.GetItemsAndBOMsFromItemIds() to convert the Item BOM to the Package BOM.  Next you call PackageService.DownloadPackage() to convert the Package BOM into a file.

Import works pretty much the same way but in reverse.  The major difference is that the Package BOM has can detect conflicts in the import.  For example, if you try to import revision A of an item but Vault has the same item at revision B, that's a conflict.  The Package BOM allows you to see, and sometimes fix, conflicts like these before the Item BOM gets updated.


Legacy Behavior:

The original intent of the Package service was to be an integration point between Vault and ERP Systems.  The original name for the service was the ERPService and you can still see ERP used in a few class names.  Out of the box, Vault supported compatibility to Microsoft Great Plains.  There was an Axapta integration too, but I think it required Autodesk Consulting.  Both integrations consisted of Vault importing/exporting data to a Microsoft Message Queue (MSMQ).

The intent was to support more integrations and maybe even have a pluggable interface.  But once the Job Server feature was developed, it became the main focus for integrations.  I wouldn’t go as far to say that the Package Service is gathering dust, but I don’t expect any other systems to be added to the Package Service.  You can basically import/export to an MSMQ or a file (which is labeled as “other” in the UI).  As far as I know, the MSMQ features still work, so you can use it as an alternative to Vault job queue.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading