編輯

共用方式為


Option Element (WorkflowInfo)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Used to populate DesignerType drop-down list box controls that are not data bound. Option elements contain text and value pairs that can be used to build a workflow sentence. They also contain information about their Microsoft .NET data types.

Definition

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

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

**Name**

**String**. The value that is displayed in the drop-down list box control.

**TypeFilter**

**String**. Used only if the parent **FieldBind** **DesignerType** is **Operator**. The **TypeFilter** attribute allows options to be hidden or displayed in the workflow editor, based on the data type of the parent element.

You can define multiple types for the **TypeFilter** attribute, but they must be separated by commas.

**UnaryHides**

**String**. Used only if the parent **FieldBind** **RuleDesigner** type is **Operator**. The value that is specified in this attribute should be synchronized with the **Field** attribute of a **FieldBind** element. If this option is selected, the **FieldBind** specified here will be hidden from the workflow editor.

**Value**

**String**. Represents the value of the selected drop-down list item.

Value attribute

The following table contains attribute values that are used with a TypeFilter attribute of Operator that performs conditional comparisons. Custom values can be substituted.

Value

Description

**Equal**

Returns **true** if queried values are equal. Case sensitivity must match.

**EqualNoCase**

Returns **true** if queried values are equal. Case sensitivity does not need to match.

**NotEqual**

Returns **true** if queried values are not equal. Case sensitivity must match.

**NotEqualNoCase**

Returns **true** if queried values are not equal. Case sensitivity does not need to match.

**StartsWith**

Returns **true** if queried values start with a specific pattern.

**NotStartsWith**

Returns **true** if queried values do not start with a specific pattern.

**EndsWith**

Returns **true** if queried values end with a specific pattern.

**NotEndsWith**

Returns **true** if queried values do not end with a specific pattern.

**Contains**

Returns **true** if queried values contain the specified pattern.

**NotContains**

Returns **true** if queried values do not contain the specified pattern.

**ContainsNoCase**

Returns **true** if queried values contain the specified pattern.

**Matches**

Returns **true** if queried values match a specified regular expression.

**IsEmpty**

Specifies empty string.

Child elements

None

Parent elements

FieldBind

Example

The following XML demonstrates how to construct an Option element so that it is visible to the workflow designer.

    <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>

See also