Friday, December 12, 2008

How to deploy a workflow in moss

Hi All,

Deploying a workflow is one of the major concerns when you develop the workflow because developing the software or anything is only half job done. The other half is deploying the code and software that you have developed.

so here we look forward on how to deploy a workflow in moss.

I will give you here the brief idea about how exactly we can proceed to have a structure of workflow and finally what files are needed for workflow to deploy.

Here keep in mind that I am talking about the workflows developed using the Visual Studio. we are not talking about workflow designed by the Sharepoint Designer.

To start with, you should have a workflow dedicated project in which your entire workflow will reside.

Give name of the Project and then Create Folder Structure inside it just like shown below.



The above should be the structure where you can have your feature Files and related ASPX files if any like association and initiation pages for the workflow.

Now double click the workflow.xml and right click and select insert snippet and then Windows Sharepoint Service Workflow> and then workflow.XML Which will give you the complete XML which you are required to use.





Snippets give you the clear idea about the replacement of tokens that we have to make. So all the green tokens need to be replaced by appropriate values.

Replace Name with the name of the Workflow that you want to give.

ID must be unique GUID. Generate it from Visual Studio Tools>Create GUID option

Tokens are self explanatory. So replace it accordingly.

Same way, use the Insert snippet and this time select feature.xml



Replace the Unique GUID and other tokens.

So here are the total files that are required for workflow to deploy:

(1) Your workflow code assembly
(2) Feature file
(3) Custom Forms if needed
(4) Workflow file which is also called workflow definition file.

Folder under feature and folder under layouts will have the same name.

Copy those folders and paste them in respective 12 hive folder. Give your assembly strong name and build your project. Place assembly in GAC.

Now your feature is ready for deployment.

Install the feature and activate that feature, so if your feature is installed at site level, you will find it at site collection administration or else you will find in the site administration under specific web. And if the feature is activated, you will find the workflow in Workflow Settings under document library and list.

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com