Top Ads One Liner

Sequential Workflow for Sharepoint WSS 3.0

Make sure you install WSSWorkflowStarterKitB2.msi first.

1. Click Visual Studio New Project then select WSS Sequential Workflow Project
2. Give the project a name
3. Once the project has been created, double-click the Workflow1.cs file from the Solution Explorer to show the workflow that was automatically created
4. Add Tab from toolbox and choose items to be placed on this box
5. Drag LogToHistoryListActivity and apply changes on properties//From the toolbox drag a CreateTask activity, a OnTaskChanged activity, a Code activity, and a DeleteTask activity in sequence to the design surface
6. Sign a strong key name, to do this:
(a) Right Click Project and Click Properties
(b) Go to Signing Tab then create a new strong name key, you can either password protect it or not
7. Modify the Feature.xml to Deploy the Workflow
8. Go to feature.xml and insert snippet WSS workflow then feature.xml code
(a) Right click on this page and select "Insert Snippet"
(or press Ctrl+K, then X)
(b) Select Snippets->Windows SharePoint Services Workflow->Feature.xml Code -->
Create GUID by going to Tools
(i) Select Tools->Create GUID from the Visual Studio menu.
(ii) Verify that the Create GUID application has the Radio button for Registry Format (ie. {xxxxxxxx-xxxx … xxxx }) selected.
(iii) Click the Copy button in the Create GUID application.
(iv) Switch back to Visual Studio and the Feature.xml file.
(v) Strip the leading and closing braces from the GUID that was pasted in.

9. Then Go to workflow.xml and do the same steps
Addition to procedures:
(i) We need to get the correct assembly name
(ii) Retrieve the full strong name string we need from Lutz Roeder’s .NET Reflector.
(iii) Replace value of CodeBesideAssembly with the version..
(a) Next open a Visual Studio 2005 command prompt. This can be done by selecting it from the Start menu. The entry is located under Visual Studio 2005->Visual Studio Tools and is named Visual Studio 2005 Command Prompt.
(b) Navigate to the directory where the project DLL is created. In our example I created the solution in C:\Work\Development\grades. The debug DLL is created under bin\debug by default so the command to change to the correct directory is 'CD \work\Development\grades\bin\debug'.
(c) Type the command 'SN –T Grades.DLL.' SN responds with the public key token for the file as shown in Figure 8.
(d) Right-click in the window and select Mark.
(e) Click and drag across the public key token. When you're done let up the mouse and press Enter.
(f) Switch back to Visual Studio and to the workflow.xml tab.
(g) Select the green highlighted publicKeyToken text and then press Ctrl-V to paste the public key token.
(h) One final edit for the CodeBesideAssembly attribute is to change the version number from to
(i) Delete the AssociationUrl, InstantiationUrl, ModificationUrl, and StatusUrl attributes because the Grades project doesn't implement any of these features.
(j) Delete the whole MetaData node and the modification element under it because the Grades workflow doesn't implement a workflow modification either.

Schemas value from Properties box is located here (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd)
Click Install.bat
The first search and replace is for MyFeature and replace it with what you want to name your feature
The second search and replace is for http://localhost with the name of your server.
Include REM on (stsadm -o activatefeature -filename HelloWorkflow\feature.xml -url http://localhost)

Save all settings..

Right Click on Project Then Properties
Go to build Events Tab
Add the ff to Post-build event command line
cd $(ProjectDir)

Build the project and make sure Install.bat was runned successfully..

You can now activate your workflow. Go to Home site collection features. You should see your deployed Workflow. Click Activate.

Go to your Document Library Settings
Under Permissions and Management Section look for your workflow settings
Click Add a workflow and you would see your workflow on the Select a workflow template field. Select it.
Type a unique name
Then you could configure your workflow to start upon newly added document.
Then click OK.

Add a new document.
On your document library, you will a new column which matches the association name you provided when you associated the workflow with the list.
It has the status of your workflow.

See also:

No comments: