Condition 元素

(Conditions 元素) (WorkflowInfo 元素) (Action4)

适用于:SharePoint Server 2013

表示 Condition 语句,它是规则句子的一部分,可在声明性、基于规则的无代码工作流编辑器中显示。 Condition 语句 (具有值和参数) 用于评估工作流状态并做出分支决策。

用法

    <WorkflowInfo>
          <Conditions>
                <Condition>
                   <RuleDesigner />
                   <Paramaters />
                </Condition>
                <Default />
          </Conditions>
          <Action />
    </WorkflowInfo>

元素信息

名称
元素类型
命名空间
架构文件 Actions4.xsd

定义

    <xs:element name="Condition"      minOccurs="0"     maxOccurs="unbounded"    >
               <xs:complexType>
               <xs:all>
         <xs:element name="RuleDesigner"      type="ruleDesignerType" minOccurs="1"     maxOccurs="1"    >
      </xs:element>
         <xs:element name="Parameters"      type="parametersType" minOccurs="1"     maxOccurs="1"    >
      </xs:element>
           </xs:all>
         <xs:attribute name="Type"   type="s:string"     />
         <xs:attribute name="Name"   type="s:string"      use="required"     />
         <xs:attribute name="AppliesTo"   type="appliesToTypes"      use="required"     />
         <xs:attribute name="UsesCurrentItem"   type="s:boolean"     />
         <xs:attribute name="ItemKeyType"   type="s:string"     />
         <xs:attribute name="FunctionName"   type="s:string"     />
         <xs:attribute name="Assembly"   type="s:string"     />
         <xs:attribute name="ClassName"   type="s:string"     />
         <xs:attribute name="ShapeImageUrl"   type="s:string"     />
           </xs:complexType>
      </xs:element>

元素和属性

如果架构定义了特定要求(如 sequenceminOccursmaxOccurschoice),请参阅定义部分。

父元素

元素

类型

说明

条件


子元素

元素

类型

说明

参数

parametersType

RuleDesigner

ruleDesignerType


属性

属性

类型

必需

说明

可能的值

**AppliesTo**

appliesToTypes

必需

指定正在计算的条件语句是应用于 SharePoint 列表还是文档库。 通过对值进行更改,可以在工作流编辑器中显示或隐藏特定的条件语句,具体取决于与工作流关联的 SharePoint 列表的类型。 以下是允许的值:

  • **all** 指定条件语句可用于所有列表库和文档库类型。

  • **doclib** 指定仅当工作流与文档库关联时,才对工作流编辑器可见条件语句。

  • **list** 指定仅当工作流与 SharePoint 列表关联时,才对工作流编辑器可见条件语句。

  • **none** 指定在工作流编辑器中隐藏条件语句。

appliesToTypes 类型的值。

**装配**

s:string

可选

指定包含 Condition 元素实现代码的 .NET 程序集。

示例:

'''Assembly=“Microsoft.SharePoint.WorkflowActions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=c9b3ceac-xxxxx-xxxxx-xxxxx-xxxxxxxxxxxxxxx”''

s:string 类型的值。

**ClassName**

s:string

可选

包含实现条件元素代码的完全限定类名。

s:string 类型的值。

**FunctionName**

s:string

可选

类中实现 Condition 代码的布尔值方法的名称。

示例方法:

'Bool myCondition (WorkflowContext context, string ListGUIDorName, int ItemWorkflowAttachedTo) '

Xml:

'FunctionName=“myCondition”'

s:string 类型的值。

**ItemKeyType**

s:string

可选

默认对象类型的特定于实现的标识符。

s:string 类型的值。

**名字**

s:string

必需

指定条件的本地化名称。

s:string 类型的值。

**ShapeImageUrl**

s:string

可选

图像文件的 URL,表示在可视设计器中表示的条件相关形状。

s:string 类型的值。

**类型**

s:string

可选

指定 “Condition” 元素是 “Custom” 还是 “Advanced”。

  • 自 定义 用于将当前 SharePoint 列表或文档库项目中的值与工作流设计器指定的值进行比较。

  • 先进 用于指示 Condition 可用于比较任何类型的两个值, (例如文本、整数和日期) 。

s:string 类型的值。

**UsesCurrentItem**

s:boolean

可选

指定当前所选项是否与工作流相关联。 如果设置为 “true”,则工作流绑定到启动工作流实例的 SharePoint 列表项或文档库项。 使用声明性工作流编辑器或设计器图面时,此值始终返回 true,并且无法更改。

s:boolean 类型的值。

备注

每个 Condition 元素还对应于指定 SharePoint 工作流库中的 布尔 方法。 这些方法用于计算由其参数传递的值并返回 truefalse

Condition 元素包含有关实现条件代码的 Microsoft .NET 程序集的信息,以及进行函数调用所需的参数。 它还包含有关应如何对工作流编辑器显示 Condition 语句的信息。