UPDATE: This has been released to CodePlex here: http://www.codeplex.com/spdwfextensions
UPDATE: See here for latest release notes: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!381.entry
UPDATE: See here for my thoughts on commercializing this project: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!569.entry
This project provides a custom activity in SharePoint Designer. Use this custom activity to invoke (dispatch) any C# function that you incorporated into the linked assembly.
As of late October, 2007, this is just an initial version of the project. I plan to expand it with a number of additional functions, including substring, index, replace, invoking web services and anything that seems useful or interesting. I also plan to post this to codeplex once I have my act together on that front. This will also be deployable as a solution at some point.
If you have any comments, questions or suggestions, please leave them in comments or email me.
Disclaimer:
I make absolutely no claims as to the suitability of this for any purpose. Use at your own risk.
Installation steps (to be followed for each WFE in the farm):
1. Download the .zip and extract.
2. Install the .dll into the GAC. I usually open c:\windows\assembly using windows explorer and copy it there.
3. Modify web.config to add the assembly to the safe controls:
<System.Workflow.ComponentModel.WorkflowCompiler>
<authorizedTypes>
<authorizedType Assembly="SpdGenericInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abe076fd8125f3c4" Namespace="Nivlag" TypeName="*" Authorized="True" />
4. Copy "SpdGenericInterface.actions" to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\Workflow
Note that the above location is specific to english language installations.
5. Close SharePoint Designer (if it’s already open).
6. iisreset
7. Open SPD and create a new workflow.
If all goes well, you should be rewarded with a new category of action:
Notes:
See here (http://blogs.msdn.com/sharepointdesigner/archive/2007/03/15/adding-activities-to-spd.aspx) for a terrific overview of the process for creating, installing and configuring a solution like this.
The .zip is designed to extract directly to you c:\ drive. If you do this, you can open the project and all the paths will be consistent.
To use this in visual studio, you probably need to install "Extensions for Windows WF".
The initial upload contains just one "dispatcher function", "ToLower()". To add more functionality, add it to the Execute method as shown:
protected override ActivityExecutionStatus
Execute(ActivityExecutionContext executionContext)
{
string functionToDispatch;
functionToDispatch = this.DispatchFunction.ToLower();
switch (functionToDispatch)
{
case "tolower()":
{
this.OutResult1 = this.InParam1.ToLower();
break;
}
default:
{
this.OutResult1 = "Unknown function: [" + this.DispatchFunction + "].";
break;
}
}
return ActivityExecutionStatus.Closed;
} // ActivityExecutionStatus
}
Then, re-build the project and copy the assembly to the GAC. I expect an iisreset would be required.