Hopefully you've walked through the first article and successfully created your InfoPath 2007 forms and the Visual Studio project needed to create our simple sequential worklow. Now we need to set about deploying it. First let's look at feaure.xml in DeploymentFiles\FeatureFiles. Copy and paste the following xml into that file:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="1E6D3BDD-9877-41ec-826C-EDE276EB560B" Title="Nicks Workflow" Description="Nicks workflow the same as the simple sequential one."
Version="12.0.0.0"
Scope="Site"
ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
ReceiverClass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="workflow.xml" />
</ElementManifests>
<Properties>
<Property Key="GloballyAvailable" Value="true" />
<!-- Value for RegisterForms key indicates the path to the forms relative to feature file location -->
<!-- if you don't have forms, use *.xsn -->
<Property Key="RegisterForms" Value="*.xsn" />
</Properties>
</Feature>
Here you can change the name of your workflow Title and Description. It would also be a good idea to generate your own guid id and add it as the Feature Id.
The next file we need to look at is workflow.xml. Copy and paste the following xml into that file.
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow Name="Nicks Sequential Workflow." Description="Simple workflow that creates a review task and waits for the user to complete it."
Id="48500BEB-D1BE-4ec4-8D21-5DEF76BEEDA8"
CodeBesideClass="NicksWorkflow.Workflow1"
CodeBesideAssembly="NicksWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0ac2d69683afd41e"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
AssociationUrl="_layouts/CstWrkflIP.aspx"
InstantiationUrl="_layouts/IniWrkflIP.aspx"
ModificationUrl="_layouts/ModWrkflIP.aspx">
<Categories/>
<!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have -->
<MetaData>
<Instantiation_FormURN>urn:schemas-microsoft-com:office:infopath:DemoInitiation:-myXSD-2007-03-03T23-40-46</Instantiation_FormURN>
<Association_FormURN>urn:schemas-microsoft-com:office:infopath:DemoInitiation:-myXSD-2007-03-03T23-40-46</Association_FormURN>
<Task0_FormURN>urn:schemas-microsoft-com:office:infopath:TaskEdit:-myXSD-2007-03-03T23-45-45</Task0_FormURN>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
Again you are free to change the title and description attibutes here, and also again it's best to generate your own guid id for the id attribute. The code beside class is the fully qualified name of your workflow class, eg namespace.classname. The CodeBesideAssembly is made up of the name of your dll (you can often take this as being the project name), the assembly version which is set in the Properties\AssemblyInfo.cs file. To get the public key value of our assembly we need to open a Visual Studio 2005 Command Prompt. This can be found via the start menu by going Start -> Program Files -> Visual Studio 2005 -> Visual Studio tools -> Visual Studio 2005 Command Prompt
In the command prompt type : sn -T "path to your workflow dll"
The only other parts you need to worry about for this workflow are the formURN's. These are used to identify exactly which InfoPath form should be used at each point. You can find these values by opening your published InfoPath 2007 forms in design mode (right click on them in explorer and chose design), then from the main menu go File -> Properties, and the value will be in the ID field:
We are only going to build and deploy our workflow in debug mode so we don't need to worry about the files in the Production Folder.
When we do a Re-Build of our solution the PostBuildActions.bat file will be executed. From a new project however in the post build actions of the project a parameter of NODEPLOY is passed to it so our workflow feature is not deploy. To change it so our workflow is deployed do the following steps:
1, Right click on your workflow project and chose Properties
2, Select the Build Events tab from the project properties screen.
3, In the textbox for the "Post-build event command line:" the last parameter of the line will be NODEPLOY. Change this to simply DEPLOY
And that is it. To build and deploy our solution simply rebuild it. Generally this can be done by pressing F6 or going Build -> Rebuild Solution from the main menu.
You should get something similar to the following text in the output window. If you get an errors detailed here hopefully there should also be a hint of how to fix it. Something else to check before trying to bind your new workflow to a document library is that the correct files have been deployed to the 12 hive. Look in ..\12\TEMPLATE\FEATURES\NicksWorkflow - or whatever you called your workflow and you should see feature.xml, workflow.xml, DemoInitiation.xsn and TaskEdit.xsn.
If the deploy seemed to run ok and you have all the files in your Feature folder, go and try your workflow out! Good luck!
I hope all the above makes sense. As with the previous workflow article this is my own attempt at explaining quite a tricky process (and very annoying if you get wrong and can't figure out why! :-) ) If you spot any inaccuracies please let me know in the comments.