BPINirvana

Friday, May 13, 2005

Deploy, Bind, Enlist & Start. Need to say more?


a very busy week; one of the biggest projects is getting to see the light, alot of tight deadlines and deliveries. anyway it is getting out which is good ;)

Okay so now you decided i wonna go develop some BTS projects to do some functionlity - whatever it's for now- the first question you gonna ask yourself is how am i going to build/structure my solutions you have alot of stuff @ hand orchs maps schemas custom components and whatever that comes into picture there. below are so thoughts i found comes handy intime of needs

Rules:
- Keep your projects small as possible as it will affect the time it takes to deploy to BTS DBs
- Keep Maps in seprate project those little devils really take alot of time to compile. though in size comparson BTS orch project produces bigger assemblies.

BTS Solutions Structure:

Solution 1: Pipelines and thier helperss & support components.
Project A- .NET Class Library:
Contains pipleline components (GAC these components)
Project B- .NET Class library:
Contains .NET classes that your pipleline components consume.
Project C- Pipelines:
Contains your BTS piplelines (this project will be GACed so you should strong name it)
Solution 2: Buisness Process and thier helpers
Project A: Schemas (Strong named as it goes into GAC). this project output will be referenced from almost everything(pipleline assmblers & disassmblers, orchs ...etc).
Project B: Transform
Your Maps and thier XSLTs if your are using them (GACed as well)
Project C: Process
Your Process orchs
Project D: .NET class that you Business process consumes. (GACed as well)

You think your done? the answer is yes if you want just to start. but the real answer is no if you want to make your life is easier moving on

Okay during the development a big percentage of time you will be doing Deployment, binding enlistment and starting.

in to move things from Development environment to Staging Environment i would strongly recommend nAnt deployment with the help of this sample doc

However in to deploy things on your machine you need something easier to configure and very very user friendly.

I have found that batch files are the best (faster and easier to maintain - remember that any code you write you will have to maintain and debug).

here how they should look like (& they should run in the following sequence):
  • Termination Exe(terminating any orch intances):a good guy Sherif ElMeteny developed an EXE that terminates any instance of orchs running on local BTS using WMI. Note DON'T run this on production environment. (the exec is avaliable on my workspace). you can run the EXE using the following command: BiztalkWMI.exe Terminate
  • Stopping Orch Batch: this batch stops the running orchs on Local BTS. should look like

cscript /NoLogo StopOrch.vbs "Fully Qulified Orch Name" "Assembly Name" Unenlist

Note: Keep StopOrch.vbs - found in BTS directory/SDK/Sampls/Admin/ in the same folder

  • Undeployment Batch: undeploys certain assemblies: the batch should contains commands like
BTSDEPLOY REMOVE NAME= VERSION=1.0.0.0 Culture=neutral PUBLICKEYTOKEN=XXXXX UNINSTALL=True LOG=BTS.undeploy..process.log

BTSDEPLOY REMOVE NAME= VERSION=1.0.0.0 Culture=neutral PUBLICKEYTOKEN=XXXXX UNINSTALL=True LOG=BTS.undeploy..process.log

BTSDEPLOY REMOVE NAME= VERSION=1.0.0.0 Culture=neutral PUBLICKEYTOKEN=XXXXX UNINSTALL=True LOG=BTS.undeploy..process.log

  • Deployment Batch: deploys certain assemblies: the batch should contains commands like

BTSDEPLOY DEPLOY ASSEMBLY="C:\Projects\BuildOut\ProjectNameSpace.Schemas.dll" INSTALL=True LOG=BTS.deploy.ProjectName.schema.log

BTSDEPLOY DEPLOY ASSEMBLY="C:\Projects\BuildOut\ProjectNameSpace.Transform.dll" INSTALL=True LOG=BTS.deploy.ProjectName.Transform.log

BTSDEPLOY DEPLOY ASSEMBLY="C:\Projects\BuildOut\ProjectNameSpace.Process.dll" INSTALL=True LOG=BTS.deploy.ProjectName.Process.log

BTSDEPLOY IMPORT BINDING="C:\Projects\BuildOut\PortBinding.xml" LOG=bts.deploy.Project.binding.log (this file is imported after the deployment using BTS deployment wizard)

  • Starting Orchs Batch: this batch starts the orchs after a deployment: should look like

cscript /Nologo EnlistOrch.vbs "Orch Fully qualified name" "Assembly Name" Start

Note: Keep EnlistOrch.vbs - found in BTS directory/SDK/Sampls/Admin/ in the same folder

As you have noticed these batch files are easy to maintain and run on the development environmnt i have noticed that the best thing is to run them then go grap a coffee, that explains my too mainy coffee/smoking breaks ;)

anyway. one challenge is if you renamed a port and you tried to deploy using the old binding file you will get address confilcts, so there is a couple of VBs that i have developed that delets all sendports and all recieve ports. (needless to say don't run those on production environment)

I have published samples to these batchs on the workspace with the ability to add GAC DLLs as well. they might come handy as you have noticed

well, that was a long post! keep me posted with your comments and feedback, use my Gmail address (khnidk@gmail.com)

Enjoy Deployment :)

Kal

0 Comments:

Post a Comment

<< Home