Condition Element (WorkflowActions)
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Represents a Condition statement, which is part of a rule sentence that can be displayed in a declarative, rules-based, code-free workflow editor, such as Microsoft Office SharePoint Designer 2007.
When a workflow is triggered by an event corresponding to a SharePoint list or document library item in Windows SharePoint Services 3.0, it is often necessary to evaluate what workflow action should be taken or if an action is required. A Condition element allows the workflow to perform this evaluation with the values and arguments provided to it by the workflow editor.
Each Condition element also corresponds to a Boolean method inside a specified Windows SharePoint Services 3.0 workflow library. These methods are used to evaluate values passed by their parameters and return either true or false.
A Condition element contains information about the .NET assembly where the Condition code is implemented, as well as the parameters that are required to make the function call. It also contains information about how the Condition statement should be displayed to the workflow editor.
<WorkflowInfo>
<Conditions>
<Condition>
<RuleDesigner>…</RuleDesigner>
<Paramaters>…</Parameters>
</Condition>
<Default>…</Default>
</Conditions>
<Action>…</Actions>
</WorkflowInfo>
Attributes
Attribute |
Description |
---|---|
AppliesTo |
Required text. Specifies that the conditional statement being evaluated is applied to a SharePoint list or document library. By changing the value, you can show or hide a specific condition statement in the workflow editor, depending on the type of SharePoint list that the workflow is associated with. The following values are not case sensitive:
|
Assembly |
Required text. Specifies the .NET assembly that contains the implementation code for the Condition element. Value type: String. Specifies the .NET assembly that contains the workflow code. The format should be as follows: Assembly name, Version, Culture, PublicKeyToken Example: Assembly="Microsoft.SharePoint.WorkflowActions, Version=12.0.0.0, Culture=neutral, PublicKeyToken= 71e9bce111e9429c" |
ClassName |
Required text. Contains the fully qualified class name in which the Condition element code is implemented. Value type: String. Fully qualified class name in which the custom Condition element code is implemented. Example: XML: ClassName=”Microsoft.SharePoint.WorkflowActions.Helper" |
FunctionName |
Required text. Name of the Boolean method in the class that implements the Condition code. Value type: String. Represents the method name in the class in which the Condition element code is implemented. Example method: Bool myCondition(WorkflowContext context, string ListGUIDorName, int ItemWorkflowAttachedTo) XML: FunctionName="myCondition" |
Type |
Optional text. Specifies whether the Condition element is Custom or Advanced. The following values are not case sensitive:
|
UsesCurrentItem |
Optional Boolean. Specifies that the item currently selected is associated with the workflow. Value type: Boolean. If set to true, the workflow binds to the SharePoint list item or document library item that started the workflow instance. When using a declarative, code-free workflow editor, this value always returns true and cannot be changed. |
Child Elements
Parent Elements
Example
The following example shows how to expose a Condition element to the code-free editor during the workflow design process.
<WorkflowInfo Language="en-us">
<Conditions And="and" Or="or" Not="not" When="If" Else="ElseIf">
<Condition
AppliesTo="list"
Assembly="MyWorkflowProject.Workflow1,
PublicKeyToken=71e9bce111e9429c,
Version=1.0.0.0,
Culture=neutral"
ClassName="MyWorkflowProject.Workflow1.MyClass"
FunctionName="IsOrderComplete"
Name="Check if item in %1 is a complete order"
Type="Custom"
UsesCurrentItem="True">
<RuleDesigner>...</RuleDesigner>
</Condition>
</Conditions>
</WorkflowInfo>
See Also
Concepts
Workflow Actions Schema Overview
Creating Declarative, No-Code Workflow Editors