Script for Automatically Creating BizTalk Solution Structure

Every organization (and developer) has their own development project structure. I’ve set up a BizTalk project structure that my company will use for all new BizTalk projects. To make life easy, I also built a simple VBScript file to automatically build the structure for us.

My folder structure looks like this:

I’ve got a spot for deployment packages (Installation), test files, instance data, file adapter pickup/dropoff (Filedrops), strong name key(s), and the actual projects. What’s nice is that each BizTalk project’s strong name key reference looks the same (..\..\..\..\Keys\MyCompany.snk). No hard coded file path. So far, this has worked really well for me.

To make construction of this structure easier, I built the following script. Just copy and paste it into a .vbs file and you’re good to go.

‘*******************************************

‘ BizTalk Project Structure Creation Script
‘ Created by: Richard Seroter
https://seroter.wordpress.com

‘*******************************************

‘declare variables
Dim objFSO, objFolder, strDirectory, strProjectName, strRootFolder, strCurrentFolder

‘request data from user
strDirectory = InputBox(“Set path here (e.g. C:\BizTalk\Projects)”, “Set path”)
strProjectName = InputBox(“Set project here (e.g. MyCompany.Department.Project):”, “Set project”)

‘set root folder of the project
strRootFolder = strDirectory & “\” & strProjectName

‘ Create FileSystemObject
Set objFSO = CreateObject(“Scripting.FileSystemObject”)

‘ Create BizTalk project root folder
Set objFolder = objFSO.CreateFolder(strRootFolder)

‘create BizTalk folder: Documentation
strCurrentFolder = strRootFolder & “\” & “Documentation”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Filedrop
strCurrentFolder = strRootFolder & “\” & “Filedrop”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Installation
strCurrentFolder = strRootFolder & “\” & “Installation”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Installation –> Bindings
strCurrentFolder = strRootFolder & “\” & “Installation” & “\” & “Bindings”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Installation –> Packages
strCurrentFolder = strRootFolder & “\” & “Installation” & “\” & “Packages”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Installation –> Scripts
strCurrentFolder = strRootFolder & “\” & “Installation” & “\” & “Scripts”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Instance Data
strCurrentFolder = strRootFolder & “\” & “Instance Data”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Keys
strCurrentFolder = strRootFolder & “\” & “Keys”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Projects
strCurrentFolder = strRootFolder & “\” & “Projects”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Templates
strCurrentFolder = strRootFolder & “\” & “Templates”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

‘create BizTalk folder: Tests
strCurrentFolder = strRootFolder & “\” & “Tests”
Set objFolder = objFSO.CreateFolder(strCurrentFolder)

WScript.Echo “Finished creating ” & strProjectName
WScript.Quit

Any changes you might suggest?

Technorati Tags:



Categories: BizTalk

5 replies

  1. Richard, Interesting stuff. I just started writing a tool to do this taking inspiration from the TreeSurgeon tool developed by Mike Roberts of ThoughtWorks. That is quite cool as it uses NVelocity and creates the structure as well as adds in stub proj files, cs files and even writes build files. I’m planning to extend this concept with the .vstemplate ideas so it will build the tree, the basic biztalk solution with schemas, maps, orchestrations etc as well as generate all the msbuild files for the same. Also planning to let people customize the kind of solution structure they want to use. Will post when thats done. Should be ready in a few days.

    cheers
    benjy

    • Hi Benjy:

      I know its been over 2 years. But would it be possible for you to forward me the tool “Script for Automatically Creating BizTalk Solution Structure” (or a link if its posted somewhere) that you were going to build?

      Thanks.

  2. Some notes:

    – I find that I frequently end up using several variations of binding files, in different environments (dev/test/prod/integration/…), so I split those up;

    – I do the same for the btsntsvc.exe.config file, which occasionally I have to use for simple configuration;

    – I find that “Instance Messages” get outdated really quick. I’ve opted for not generating them, and the only instances in my projects are in the Test/BizUnit projects.

  3. Hey Benjy,

    This is real good stuff you developing, i am soon starting a new project on BTS 2006. It would be very helpful for me to get the folder structure done for my developers.

    Can you please share the solution with me.

    Thanks,
    Ashish

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: