Specifies a Windows Workflow Foundation (WF) workflow that references an assembly for the workflow’s implementation.
Real World Example
A developer wants a workflow-enabled list that has complex processing requirements. She develops a coded workflow using the WF Workflow Designer and packages it as a feature for installation in the SharePoint environment.
A coded workflow is composed of a workflow .xml file, workflow assembly, and potentially various ASPX files or Microsoft Office InfoPath forms used during execution of the workflow. Coded workflows use the complete workflow capabilities of the WF.
WF supports multiple workflow-authoring styles, such as sequential, state machine, and data-driven. The sequential style is straightforward and useful for repetitive, predictable operations that are always the same. The state machine workflow style consists of a set of event-driven states. The data-driven style relies on data to determine whether or not certain activities are run based on a local data state. All of these workflow-authoring styles are supported in a coded workflow.
The following is an example from the Translation coded workflow feature included in Microsoft Office SharePoint Server 2007, which includes both ASPX forms and InfoPath forms references.
<Workflow Name="$Resources:Translation_Title;" Description="$Resources:Translation_Description;" Id="B4154DF4-CC53-4C4F-ADEF-1ECF0B7417F6" CodeBesideClass="Microsoft.Office.Workflow.XlateWorkflow" CodeBesideAssembly="Microsoft.Office.Workflow.Routing, Version=22.214.171.124, Culture=neutral, PublicKeyToken=71e9bce111e9429c" TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160" AssociationUrl="_layouts/XlateWfAssoc.aspx" InstantiationUrl="_layouts/IniWrkflIP.aspx" ModificationUrl="_layouts/ModWrkflIP.aspx"> <Categories/> <MetaData> <AssociationCategories>List;29d85c25-170c-4df9-a641-12db0b9d4130;1300</AssociationCategories> <Instantiation_FormURN>urn:schemas-microsoft-com:office:infopath:workflow:Xlate-Init:$Subst:LCID;</Instantiation_FormURN> <Task0_FormURN>urn:schemas-microsoft-com:office:infopath:workflow:Xlate-Complete:$Subst:LCID;</Task0_FormURN> <Modification_8ed87eeb-8e95-417f-937d-45b6a78ac73b_Name>$Resources:Translation_WrapItUp;</Modification_8ed87eeb-8e95-417f-937d-45b6a78ac73b_Name> <Modification_8ed87eeb-8e95-417f-937d-45b6a78ac73b_FormURN>urn:schemas-microsoft-com:office:infopath:workflow:OOB-WrapItUp:$Subst:LCID;</Modification_8ed87eeb-8e95-417f-937d-45b6a78ac73b_FormURN> <Modification_Format><my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD"></my:myFields></Modification_Format> <ExtendedStatusColumnValues> <StatusColumnValue>$Resources:Translation_StatusErrorOccurred</StatusColumnValue> <StatusColumnValue>$Resources:Translation_StatusErrorCancelled</StatusColumnValue> <StatusColumnValue></StatusColumnValue> <!-- Used for clearing status field for placeholder docs when auto-initiated --> </ExtendedStatusColumnValues> </MetaData> </Workflow>
You can develop coded workflows by using the WF Workflow Designer, which is part of Windows Workflow Foundation Extensions for Visual Studio 2005. Developers can use the WF Workflow Designer to graphically define workflow activities and set the order in which to execute those activities.
A good overview of the Windows Workflow foundation as used in Office SharePoint Server 2007 and Windows SharePoint Services 3.0 is presented in the whitepaper Understanding Workflow in Microsoft Windows SharePoint Services and the 2007 Microsoft Office System (Chappell, 2006).
Coded workflow assemblies must be installed in the global assembly cache to function. This allows the code to run with full trust and as such should be carefully examined to determine security threats. Also, because workflows are server-side code, they should be reviewed for performance concerns.