Infosys Microsoft Alliance and Solutions blog

« Cloud computing made possible with Azure | Main | Handling Thread Exceptions »

Microsoft Blueprint Walkthrough – Creating My First Blueprint

One of my colleague, Archana Sachin Ghag who is a key member of our software factory team has just finished writing a Blueprints Walkthrough. I am sharing this walkthrough with rest of the development community hoping it may act as a jumpstart for your Blueprints adoption.

Before you start creating your own Blueprint using Microsoft’s Blueprint Manger go through this article which introduces Blueprint Concept and Blueprint Manager. To start building your own Blueprint, Blueprint Manager comes with “Microsoft Blueprint Factory” which is nothing but a Blueprint itself.

When you select “Microsoft Blueprint Factory” from Blueprint Manager and click “Unfold”, it prompts for project you want to unfold this Blueprint Factory. I usually prefer Blank Solution to unfold Blueprint Factory.

Figure - 1

Before unfolding starts, user will be prompted for the project name.

Figure - 2
By default, the name is shown as BlueprintFactory. You can change the name according to your requirements. I will say it as MyFirstBlueprint.
Unfolded project in blank solution will look like this.

Figure - 3
When you right click MyFirstBlueprint project you get a context menu with caption “Blueprints” containing different options to configure various aspects of the blueprint.

Figure - 4
Note: Menu item Blueprints is the key for Blueprint development. All guidance is provided through this menu. Whenever a blueprint is unfolded on a machine, it adds a blueprint context menu item specific to this unfolded blueprint which provides guidance to the developer.

Next step is to configure my Blueprint. Click Blueprints -> Edit Configuration. Blueprint will display Blueprint Editor which allows user to configure all possible options available with blueprint viz.

1. General Configuration
2. Options
3. Menus
4. Commands
5. Related Blueprints
6. Installation Actions.

In this article we will see some of the general configuration settings and further discuss how to implement commands and menus in our custom blueprints.
Edit Configuration will show the following dialogue box.

Figure - 5
On Configuration Tab you can configure

1. Project Name- This name will be used during unfolding of projects and it is also important as far as build artifacts of blueprint is concerned. When we build Blueprint project it creates a zip file containing all information for RSS. The name of this file will be <ProjectName> Build will also generate folder named ‘ProjectName_Pacakge’. This contains all files needed to run blueprint. To see all this information you have to open Windows Explorer after build and see your blueprint directory. You cannot see this information in Visual Studio itself.

2. Type of Blueprint can be Microsoft or Third Party or hidden.

3. Publisher will be your company name.

4. You can also give RSS feed link here. This is very important from a delivery and deployment perspective as Blueprints Manager can update existing blueprints through this RSS Feed whenever a new version is available from within Visual Studio IDE itself.

We will now see how to use Commands and Menus Tabs to create our own Menu option for “Blueprints”.Each menu item has command associated with it. On click of this menu item, command associated with it gets executed.
Blueprint shows/executes its commands or menus from .Net library called Blueprint Extension Library. This library has to follow some standard so that blueprint understands it properly.

1. Assembly name for extension library should start with Blueprint’s project name.

2. Class which handles commands must derive from ‘BPMExtensionBase’ from ‘Microsoft.SoftwareFactories.Blueprints’

3. You must copy the extension library to “extensions” folder inside “MyFirstBlueprint” project folder.

Click Blueprints -> Add Extensions to create a new extension.

Figure - 6
It will add extension library project to the solution and set Assembly Name as required by the blueprint. Specify project name for extension using the following dialog box. 
Figure - 7

Now solution will look like this

Figure - 8

MyExtensions project contains class “ExtensionClass” with a sample command implemented that will help you to implement your own commands. You get Menu “Blueprints” even on MyExtensions project which will give option to see workflow which will give step by step guidance on how to use this project for your blueprint. Modify class ExtensionClass to implement your own commands. Build MyExtensions project using Visual Studio.

Now the next step is to specify commands from MyExtension which will be used by “MyFirstBlueprint”. For this we will again click on Blueprints -> Edit Configuration menu to get Blueprint Editor. Open Commands Tab.

Add new command and fill the details as follows

Figure - 9
Once command is added, the only step remains is to associate this command with a Menu Item. Create new Menu Item using Blueprint Editor’s Menus Tab.

Figure - 10
Visibility has many options supported as Filters. You can see all available Filters from Blueprints -> Workflow menu item.  These filters decide for which project or project item you want to show this context menu item.
Save both projects and build them. Once built and auto install is successful, you can see your blueprint entry in Blueprint manager. Unfold it and see whether you get custom menu created by you.
NOTE. Remember you have checkbox “Custom Menu Filters” checked on Blueprint Manager to see your own menus.

Figure - 11

Hope this helps to quick start Blueprint development. Once Menus are appearing you can write whole lot of customized stuff in your commands to auto generate repetitive code or provide any kind of guidance needed.







I just saw your channel 9 video and have posted some comments. Will go through this post and send feedback. Looks very useful. By the way, I also just now watched Jack Greenfields discussion with your colleagues where he mentioned that those Blueprints you developed are available for download? Is that correct? I thought they were Infosys IP only. Please let me know what the position is on this.

Thanks Santosh. I replied to your comments on Channel9. Will get back to you shortly on the blueprints availability.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter