isOptional

Description

This attribute is a flag that indicates that the search pattern is not required to find the participant. This is useful for complex participants that might have non-critical parameters to extract. You can create some patterns for distinctly identifying a participant and have some optional patterns for extracting non-critical parameters.

Parent

searchPattern

Type

Attribute.

Required

No.

Values

true, false

  • The value is true if the searchPattern is not necessary to identify the participant.
  • The value is false (default) if the searchPattern tag is required.

For example, consider the following simple recordset string:

<%var Recordset1 = Server.CreateObject("ADODB.Recordset");Recordset1.ActiveConnection = "dsn=andescoffee;";Recordset1.Source = "SELECT * FROM PressReleases";Recordset1.CursorType = 3;Recordset1.Open();%>

The search patterns must identify the participant and extract several parameters. However, if a parameter such as cursorType is not found, you should still recognize this pattern as a recordset. The cursor parameter is optional. In the EDML, the search patterns might look like the following example:

<searchPattern paramNames="rs">/var (\w+) = Server.CreateObject/</searchPattern><searchPattern paramNames="src">/ActiveConnection = "([^\r\n]*)"/¬</searchPattern><searchPattern paramNames="conn">/Source = "([^\r\n]*)"/¬</searchPattern><searchPattern paramNames="cursor" isOptional="true">¬/CursorType = (\d+)/</searchPattern>

The first three patterns are required to identify the recordset. If the last parameter is not found, the recordset is still identified.