If you try to create a new BAM definition (Excel) file by reusing and modifying another that has already been deployed, you’ll run into an error like this:


Microsoft (R) Business Activity Monitoring Utility Version 3.5.1602.0
Copyright (C) 2006 Microsoft Corporation.  All rights reserved.


Using ‘BAMPrimaryImport’ BAM Primary Import database on server ‘BIZTALKHOST’…


Deploying Activity… Done.
Deploying View… Done.
ERROR: The BAM deployment failed.
Another element with ID IDA1E04C9C6CDD4E9EA9B092556AAF511F has already been deployed.  Change the ID and retry.


You are getting this error because when you create (1) a new activity, (2) a new view, or (3) a new activity view association, an ID (GUID) is created to uniquely identify the item. This id is not regenerated when you rename the activity or the view. So when you re-purpose the Excel definition for your new activity or renaming your view, you get the above error.
There is a way around this if you don’t want to start from scratch. The following will show you how to get around this but be warned that you’ll lose the ability to get a live data workbook.


First, export the Excel definition as xml (menubar BAM -> Export XML), locate the ID that matches the error message and change it to another number (any will do, as the chances of it being used is fairly slim).


If you are reusing the template, you will likely have the same id for the Activity (//Activity/@ID), View (//View/@ID), and ActivityView (//ActivityView/@ID) nodes. Make sure you also change the referenced IDs.


Once you’ve made your modification, deploy the definition xml using the bm.exe command.