April 2007 - Posts

Biztalk Solution Templates_- 1 : VSTemplates

I've always been fascinated with the concepts and technique of automating VS development through macros, add-ins, templates etc.By now at my clients site we have more or less standardised what our Biztalk "services" look like but since we are still in Biztalk 2004 I didnt want to waste time with VS2003 automation as things have become so much more polished and advanced in later versions. I recently spent a couple of days at another client site with v2006 setting up the solution tree and MSBuild scripts and then sat back and wondered why i didnt have a tool to set the whole thing up in 5 minutes. It would have saved so much time that could have been spent on more significant issues. So today, after much procrastination (and collecting links on the subject), I finally decided to take the plunge and create my own multi-project template.

There's a wealth of material on creating Visual Studio Item and Project Templates and one of the best I've read is How to create starter kits (including multi-project templates). I gleefully put in the .net class library and test projects, schemas, maps etc and ran the Export Template Wizard. Imagine my horror when i found that it would not pick up Biztalk projects!!. So i got stuck for a while. I did have a look at Jon Flanders awesome videos on his Pattern Wizards including the facility to create biztalk project wizards from your own projects. I say, that guy is really something!! Anyway, that helps to some extent in that we can now "export" existing biztalk projects and use them later (and make them highly dynamic through wizards etc), but it still doesnt help create a multi-project template.

So I went ahead and decided to try and experiment. With the starter-kits article in hand I created the basic .NET projects and then decided to take a set of biztalk projects and add them in. I removed all the unncessary items, except for the btproj file. I then added in a .vstemplate file and a icon file (from the exported .net projects). I then edited the vstemplate file to set the links to the btproj files and so on. Ultimately having put them all together and zipped it up and dropped it into the Templates folder, voila, it worked. I have a multi-project solution with Biztalk projects in it.

In the btproj files i can set macros such as $safeprojectname$.Unfortunately no matter what I try it will not accept items such as schema files, maps etc. VS always complains that it cannot find the files even if they are included in the package. So i gave up that route and left the projects empty. I would like to try to set the Application Name as the name of the Solution in all the btproj files, but there doesnt seem to be a template parameter to do that

You can find the results of my handiwork at my new codeplex project site here . Feel free to play with it and let me know your thoughts and suggestions.

I'm thinking of extending this with add-ins and macros to create msbuild scripts to build and deploy the solutions. This would give projects a good kick start. Of course, people modularise Biztalk in many ways, some have multiple schema projects, some have multiple orchestration projects and the layout is not always the same. And of course, once you start using Jons tool, then the solution will morph into something very different from what the starter kit looked. So the Build and Deploy script generator tools must be capable of running at anytime and regenerating stuff from scratch. The codeplex site should see some growth very soon. It would also be interesting to hear how others lay out their projects especially how branching is done.

I've also written up another little tool to generate my source tree, taking inspiration from tools like TreeSurgeon. I should put that up soon. For now , i guess these tools will work together, but in a slightly disjointed fashion and in time i'll get a deeper understanding of VS automation and with stuff like GAT, theres a lot that can be done.

The big limitation right now is that doesnt link in with Jons work in any way. All my project templates that i made are sitting in the Biztalk Project Wizards folder, but the vstemplate only shows its own collection of btproj files which arent dynamic in any way. If anyone has some experience on linking VStemplates with wizards and would like to sharet the info please let me know. I'd love to be able to link my templates to Jons wizards, thus making it a highly dynamic and rich experience in creating multiproject solutions.

 

with 0 Comments

BizUnitExtensions - Important Upcoming changes

Just to inform users of BizUnitExtensions, that Kevin Smith (creator of BizUnit) and I have been having some extensive discussions on the BizUnit codeplex site (here and here) on how these two projects will continue to work together going forward since BizUnit is now active once again and Kevin has lots of plans for it and a new release with lots of good stuff is imminent.

Once the new release of BizUnit comes out the Extensions project will no longer release the core as part of the distribution but will continue to release test step libraries as it is doing now (perhaps with some structural or namespace changes), so we will have our own release schedule. I'm hoping that the changes we made to the core to allow some of the extensions to work will be retained by Kevin and that other changes we are proposing such as making all the properties publicly accessible to support tooling plans will also be acceptable.

If you would like to influence these decisions please do weigh in on the discussions at the BizUnit site. I have had some good feedback about the extensions roadmap but do continue to send us messages on what would be the most useful features.

Update: I've now put up all the items on the roadmap as work items so why not hop over to codeplex and click on the VOTE links against each work item and let me know what your favorite proposed features are?

with 0 Comments

Programmatically generating orchestrations

Martijn Hoogendoorn has re-posted the link to his utility to programmatically generate orchestrations (now that he is working for Microsoft the old link on his previous blog no longer works). Check it out here. He has used the Microsoft.Biztalk.IMS.dll which contains interfaces such as IBtsVsDocument and the Biztalk Object Model dll to do most of the generation. This is quite different to Jon Flanders Pattern Wizards which have a wizard written over a bunch of VS2005 templates to generate what you need. In this codebase, Martijn has one class which generates a sample akin to the SDK CallOrchestration sample. Its pretty nifty and demonstrates how one can use the Biztalk TypeSystem to generate ports, message references etc. One thing which puzzled me is where he got the Biztalk.IMS.dll from!! Jon has that in his codebase too but i couldnt find that anywhere on my machine! Does anyone know where we can get that or where some documentation would be available? [Update: Martijn informed me that the DLL is in the GAC and so it is!!]

So when would you want to code gen orchestrations? After all, using the orchestration designer isnt exactly rocket science and now that there is a wealth of community wisdom in the realm of patterns (encapsulated in Jons tool), why do we need this? I look at this technique as facilitating one layer of abstraction over the designer itself. Take the "Solution Designer" that Eddie Churchill demo'ed in a channel9 video  If you look at that, it shows how the Team Architect AD surface can be used to sketch your solution end to end and then generate the solution structure with stub orchestrations, schemas, maps etc. Thats a good application of DSL technology (although in the demo version it used windows forms, not the DSL toolkit which wasnt stable enough to be used at that time).

Anyway, back to the discussion. One thing about good architectures is that they should also be consistent (along with being flexible). So if you have a bunch of backend systems that expose similar interfaces to be integrated with (WS, queues, file ports etc) and if you have a choice of which interface to use, while you are well within your rights to use any way of connecting to them, IMO, a better way would be to establish a consistent pattern of connecting to them so that you can make sure your bases are all covered, your development team knows whats expected and you have a standard base for delivering estimates. So if you do this, then you can fairly well predict exactly what your "connector" looks like and then, if you have worked out the contract for your schemas etc, then you can just go ahead and code gen the entire lot. Use the VS automation model to generate the solution structure, add the various projects in programmatically and then inside each of them, use these utilities (like Martijns) to generate the rest (and in a future version of BizUnitExtensions, autogen your tests as well). This way we can maximize our "design contracts".

I do wish the Biztalk team would make the WebService Publishing Wizard available programmatically. (I guess the WSE publishing wizard is probably on its way out now that WCF is in production). This would help even more code generation. By the way, i heard that Eddie has left the BTS team and so the solution designer has been discarded. Anyone know the skinny on this? I would be terribly disappointed if this is the case because to me, that was the most compelling feature in the "future/vNext" Biztalk release (perhaps it was post R2).

By the way, I also came across another tool named BridgeWerx sometime ago that used a custom interface to sketch your biztalk solution and generate the codebase. I wonder if they have moved into the Microsoft DSL space now.

I've asked Martijn about the possibility of making this into a CodePlex project (although the source code is available with the download, putting it up as a project would make it more visible and get more collaboration). I'm sure that with more hands and more time (overall) there could be much more powerful things that could be done with the tool.

with 2 Comments