Friday, July 24, 2009

How to build and Deploy a Workflow with WSPBuilder

I'm working on adding screenshots to this, but just follow the instructions for a very simple tutorial on deploying a workflow with wspbuilder.

1. Download and run the WSPBuilder Extensions from CodePlex. http://www.codeplex.com/wspbuilder

2. Start a new project in Visual Studio. If you ran the WSPBuilder Extensions you should have a new option for project type. Choose a “WSPBuilder Project with Workflow” template.

3. Right click on the project and add a sequential workflow:
Choose a Sequential Workflow Feature Template
Choose Scope as Site.

4. You’ll notice you are missing references:
Change the Target framework to .Net 3.0 for the project.

5. Double click on the projectname.cs file inside the WorkflowCode folder. Drag a “logtoHistoryListActivity” from your toolbox directly beneath the onWorkflowActivated1. On the properties for logtoHistoryListActivity1, add text to the HistoryDescription and HistoryOutcome. Save and close the file.

6. Open the elements.xml file that was placed in 12/Template/Features/projectname/. Remove the following attributes inside the workflow node: TaskListContentId, AssociationURL, InstantiationURL, ModificationURL, StatusPageURL. Save that file.

7. Right click on the project and add a new item:
Add a Solution Installer Configuration:

8. Edit the Setup.exe.config file and delete the row with the FarmFeatureId. Save and close that file.

9. Right click on the project and build.

10. Right click on the project – WSP Builder – Build WSP. (This will build your wsp file)

11. Right click on the project – WSPBuilder – Create Deployment Folder.

12. Execute \%projectfolder%\bin\deploy\%projectname%\setup.exe on the target server. Your installer will come up, once you click Next it will do a system check, you can accept the end user license, and then you can choose which web applications to deploy to.

13. Logon to Sharepoint. Go to site actions – Site Settings – Modify All Site Settings
Under Site Collection Administration, click on Site collection features. Find your feature and click on Activate

14. Once the feature is active, go to a Document Library, and go to Document Library Settings.
Click on Workflow settings. Click on Add a workflow. Select your workflow, and choose other options.

15. Go back to the Document Library and start the workflow manually, or however you chose with start options.

16. Verify that the workflow completed.

2 comments:

Unknown said...

Thank you Very MUCH. This guide helped me a lot.

S931Coder said...

Setup.exe was missing for me so I downloaded it from http://sharepointinstaller.codeplex.com/ (V1.2.2) and copied setup.exe to the deployment folder.