WorkflowInfo Schema and WorkflowActions Schema Overview

Applies to: SharePoint Foundation 2010

You can build powerful and robust workflows to automate most common business scenarios by using a declarative, code-free workflow editor such as Microsoft SharePoint Designer 2010. However, sometimes it is necessary to build workflows around very complex and unique business requirements that cannot be accommodated by the default list of conditions and actions provided by Microsoft SharePoint Foundation 2010.

To allow a code-free editor to work with more complex business logic, you must create customized workflow objects and deploy them to the server that is running SharePoint Foundation 2010. After you deploy your customized workflow objects, the new actions and conditions are visible to the workflow editor.

For information about creating code-free workflow editors, see Creating Declarative, No-Code Workflow Editors.

For workflows to be deployed in a farm solution, create the custom actions in an .ACTIONS file that is deployed to the file system using the elements of the WorkflowInfo schema. For sandboxed solutions, create the custom actions in a Feature manifest file (elements.xml) using the WorkflowActions schema. The elements of the WorkflowActions schema are a subset of those in the WorkflowInfo schema.

WorkflowInfo Schema Elements

WorkflowActions Schema Elements

Remarks

XML schema definition files are commonly used to validate XML structure and syntax. However, for Action and Condition elements, the information that is normally contained in an XSD file, and is easily readable, is contained within SharePoint Foundation internal code.

Example

Description

The following XML example demonstrates how to construct an .ACTIONS file so that SharePoint Foundation can correctly display Action and Condition elements to a declarative, rules-based, code-free workflow editor.

Note

Elements in the following code sample have been edited for readability.

Code

<?xml version="1.0" encoding="utf-8" ?>
<WorkflowInfo>
   <Actions Sequential="then" Parallel="and">
      <Action 
         Name="Get Manager from Active Directory"
   ClassName="FindManagerActivity.FindManager"
   Assembly="FindManagerActivity, Version=1.0.0.0,   
            Culture=neutral, PublicKeyToken=ec457ebe7d96977c"
   AppliesTo="all"
   Category="Extras">
   <RuleDesigner Sentence="Get Manager information for %1 
            (Output: %2 %3 %4 %5 %6) ">
      <FieldBind 
               Field="AccountName" 
               DesignerType="SinglePerson" 
               Text="this user" 
               Id="1"/>
<FieldBind 
               Field="ManagerAccountName" 
               DesignerType="ParameterNames" 
               Text="ManagerAccountName" 
               Id="2"/>
<FieldBind 
               Field="ManagerEmailAddress" 
               DesignerType="ParameterNames" 
               Text="ManagerEmailAddress" 
               Id="3"/>
<FieldBind 
               Field="ManagerDisplayName" 
               DesignerType="ParameterNames" 
               Text="ManagerDisplayName" 
               Id="4"/>
<FieldBind 
               Field="Outcome" 
               DesignerType="ParameterNames" 
               Text="Outcome" 
               Id="5"/>
<FieldBind 
               Field="SearchSuccessful" 
               DesignerType="ParameterNames" 
               Text="IsSuccess" 
               Id="6"/>
   </RuleDesigner>
   <Parameters>
      <Parameter 
               Name="AccountName" 
               Type="System.String, mscorlib" 
               Direction="In" />
<Parameter 
               Name="ManagerAccountName" 
               Type="System.String, mscorlib" 
               Direction="Out" />
<Parameter 
               Name="ManagerEmailAddress" 
               Type="System.String, mscorlib" 
               Direction="Out" />
<Parameter 
               Name="ManagerDisplayName" 
               Type="System.String, mscorlib" 
               Direction="Out" />
<Parameter 
               Name="Outcome" 
               Type="System.String, mscorlib" 
               Direction="Out" />
<Parameter 
               Name="SearchSuccessful" 
               Type="System.Boolean, mscorlib" 
               Direction="Out" />
   </Parameters>
</Action>
   </Actions>
</WorkflowInfo>

See Also

Concepts

Workflow Development for SharePoint Foundation

Creating Declarative, No-Code Workflow Editors

SharePoint Designer Workflow Overview