Option 元素 (WorkflowInfo)

适用于:SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

用于填充非数据绑定的 DesignerType 下拉列表框控件。 Option 元素包含可用于构建工作流语句的文本和值对。 它们还包含有关其 Microsoft .NET 数据类型的信息。

定义

<RuleDesigner>
  <FieldBind>
        <Option />
  </FieldBind>
</RuleDesigner>

元素和属性

下面各部分介绍了属性、子元素和父元素。

Attributes

属性

说明

**名字**

**字符串**。 下拉列表框控件中显示的值。

**TypeFilter**

**字符串**。 仅当父 **FieldBind** **DesignerType** 为运算符时使用。 **TypeFilter** 属性允许基于父元素的数据类型在工作流编辑器中隐藏或显示选项。

可以为 TypeFilter 属性定义多个类型,但它们必须用逗号分隔。

**UnaryHides**

**字符串**。 仅当父 **FieldBind** **RuleDesigner** 类型为 **Operator**时才使用。 此属性中指定的值应与 **FieldBind** 元素的 **Field** 属性同步。 如果选择此选项,则会在工作流编辑器中隐藏此处指定的 FieldBind。

**价值**

**字符串**。 表示所选下拉列表项的值。

Value 属性

下表包含用于可执行条件比较的 OperatorTypeFilter 属性的属性值。 可以替换自定义值。

说明

**平等**

如果查询的值相等,则返回 “true”。 大小写形式必须匹配。

**EqualNoCase**

如果查询的值相等,则返回 “true”。 大小写形式不必匹配。

**NotEqual**

如果查询的值不相等,则返回 “true”。 大小写形式必须匹配。

**NotEqualNoCase**

如果查询的值不相等,则返回 “true”。 大小写形式不必匹配。

**StartsWith**

如果查询值以特定模式开头,则返回 **true**。

**NotStartsWith**

如果查询的值不以特定模式开头,则返回 **true**。

**EndsWith**

如果查询值以特定模式结尾,则返回 **true**。

**NotEndsWith**

如果查询的值不以特定模式结尾,则返回 “true”。

**包含**

如果查询的值包含指定的模式,则返回 “true”。

**NotContains**

如果查询的值不包含指定的模式,则返回 **true**。

**ContainsNoCase**

如果查询的值包含指定的模式,则返回 “true”。

**比赛**

如果查询的值与指定的正则表达式匹配,则返回 “true”。

**IsEmpty**

指定空字符串。

子元素

父元素

FieldBind

示例

下面的 XML 代码演示如何构造 Option 元素,以便在工作流设计器中显示该元素。

    <RuleDesigner Sentence="%1">
       <FieldBind Field="MyParameter1"
                  Text="text" Id="1"
                  DesignerType="Operator"
                  OperatorTypeFrom="MyParameter1">
            <Option Name="equals" Value="Equal"/>
            <Option Name="not equals" Value="NotEqual"/>
            <Option Name="is greater than"
                    Value="GreaterThan"
                    TypeFilter="System.Double;System.Int32;
                                System.Uint32;System.DateTime"/>
            <Option Name="is greater than or equal to"
                    Value="GreaterThanOrEqual"
                    TypeFilter="System.Double;System.Int32;
                                System.Uint32;System.DateTime"/>
            <Option Name="is less than"
                    Value="LessThan"
                    TypeFilter="System.Double;System.Int32;
                                System.Uint32;System.DateTime"/>
            <Option Name="is less than or equal to"
                    Value="LessThanOrEqual"
                    TypeFilter="System.Double;System.Int32;
                                System.Uint32;System.DateTime"/>
            <Option Name="is empty"
                    Value="IsEmpty"
                    TypeFilter="System.String"
                    UnaryHides="right"/>
            <Option Name="is not empty"
                    Value="NotIsEmpty"
                    TypeFilter="System.String"
                    UnaryHides="right"/>
            <Option Name="begins with"
                    Value="StartsWith"
                    TypeFilter="System.String"/>
            <Option Name="does not begin with"
                    Value="NotStartsWith"
                    TypeFilter="System.String"/>
            <Option Name="ends with"
                    Value="EndsWith"
                    TypeFilter="System.String"/>
            <Option Name="does not end with"
                    Value="NotEndsWith"
                    TypeFilter="System.String"/>
            <Option Name="contains"
                    Value="Contains"
                    TypeFilter="System.String"/>
            <Option Name="does not contain"
                    Value="NotContains"
                    TypeFilter="System.String"/>
            <Option Name="matches regular expression"
                    Value="Matches"
                    TypeFilter="System.String"/>
            <Option Name="equals (ignoring case)"
                    Value="EqualNoCase"
                    TypeFilter="System.String"/>
            <Option Name="contains (ignoring case)"
                    Value="ContainsNoCase"
                    TypeFilter="System.String"/>
            <Option Name="equals (ignoring time)"
                    Value="EqualNoTime"
                    TypeFilter="System.DateTime"/>
         </FieldBind>
    </RuleDesigner>

另请参阅