Thursday, February 11, 2016

BizTalk BAM XML Import/Export Gotcha

I've recently looked at some BizTalk code that another developer wrote, which has some BAM artifacts included in the solution.  Instead of saving the Excel xlsx file to the code repository, the developer saved the exported XML file instead.  See a portion of the original XML document below.  Notice that there is some PivotTable and RealTime Aggregation information within it.



I needed to make some updates to one of the BAM Activities, so I opened up a blank Excel document and selected "Import XML..."   The BAM Activities and Views load up just fine.



However, there was one big issue that I came across.  Sadly, the PivotTable and RealTimeAggregation information did not get loaded.  If I didn't take the time to review and compare my updates with the last version of the file (we use TFS as a code repository), I would have never known that I might have pushed an incomplete BAM process (compared to the previous version) into our database.  See the new output below.




As another test, I decided to do an import and then a direct export without any modification.  Sure enough, the RealTimeAggregation and PivotTableViews within the exported XML document were missing.

To correct this, I needed to do some reverse-engineering/trial and error with creating a new PivotTable within the Excel document and re-export the XML file out.  Then I needed to compare the old XML with the new XML to make sure I had the PivotTables and Aggregations the same.  At this point I decided to put the Excel document into source code as well... :)

Not sure if this is a bug, an oversight, or not the intent of the Import XML feature within Excel, but I would think that one could get 'mildly' burned if the source xlsx file isn't saved to your code repository.