Get BOM from PDM Document

My question is what is the correct way to get the BOM upon CheckIn?

I have a service running that listens for triggers.  It parses the trigger and decides to add items to a seperate database.  I want to gather the BOM for these parts.

What I think the answer is going to be is to Save out from the vault to a temp location and use the DocumentManager to gather the BOM information.  This is viable because it's all done in the background, but you could imagine if a drawings has several thousand parts.  This could take some time to check out.

SolidworksApi macros