The EventFilterprovides for the filtering and content selection of Event Subscriptions.

If an Event Notificationconforms to the filter defined by the whereparameter of the EventFilter, then the Notificationis sent to the Client.

Each Event Notificationshall include the fields defined by the selectClausesparameter of the EventFilter. The defined EventTypes are specified in OPC 10000-5.

The selectClausesand whereClauseparameters are specified with the SimpleAttributeOperandstructure (see 7.7.4.5). This structure requires the NodeIdof an EventTypesupported by the Serverand a path to an InstanceDeclaration. An InstanceDeclarationis a Nodewhich can be found by following forward hierarchical references from the fully inherited EventTypewhere the Nodeis also the source of a HasModellingRulereference. EventTypes, InstanceDeclarationsand Modelling Rulesare described completely in OPC 10000-3.

In some cases the same SimpleAttributeOperand.browsePathwill apply to multiple EventTypes. If the Clientspecifies the BaseEventTypein the SimpleAttributeOperand.typeDefinitionIdthen the Servershall evaluate the SimpleAttributeOperand.browsePathwithout considering the SimpleAttributeOperand.typeDefinitionId.

Each InstanceDeclarationin the path shall be Objector Variable Node. The final Nodein the path may be an Object Node; however, Object Nodesare only available for Eventswhich are visible in the Server’s AddressSpace.

The SimpleAttributeOperand structure allows the Clientto specify any Attribute; however, the Serveris only required to support the Value Attributefor Variable Nodesand the NodeId Attributefor Object Nodes. That said, profiles defined in OPC 10000-7may make support for additional Attributesmandatory.

The SimpleAttributeOperand structure is used in the selectClausesto select the value to return if an Eventmeets the criteria specified by the whereClause. A null value is returned in the corresponding event field in the Publish response if the selected fieldis not part of the Event or an error was returned in the selectClauseResultsof the EventFilterResult. If the selected fieldis supported but not available at the time of the event notification, the event field shall contain a StatusCodethat indicates the reason for the unavailability. For example, the Servershall set the event field to Bad_UserAccessDeniedif the value is not accessible to the user associated with the Session. If a Value Attributehas an uncertain or bad StatusCodeassociated with it then the Servershall provide the StatusCodeinstead of the Value Attribute. The Servershall set the event field to Bad_EncodingLimitsExceededif a value exceeds the maxResponseMessageSize. The EventId, EventTypeand ReceiveTimecannot contain a StatusCodeor a null value.

The Servershall validate the selectClauseswhen a Clientcreates or updates the EventFilter. Any errors which are true for all possible Eventsare returned in the selectClauseResultsparameter described in Table 148. Some Servers, like aggregating Servers, may not know all possible EventTypesat the time the EventFilteris set. These Serversdo not return errors for unknown EventTypesor BrowsePaths. The Servershall not report errors that might occur depending on the state or the Serveror type of Event. For example, a selectClausesthat requests a single element in an array would always produce an error if the DataTypeof the Attributeis a scalar. However, even if the DataTypeis an array an error could occur if the requested index does not exist for a particular Event, the Serverwould not report an error in the selectClauseResultsparameter if the latter situation existed.

The SimpleAttributeOperand is used in the whereClauseto select a value which forms part of a logical expression. These logical expressions are then used to determine whether a particular Eventshould be reported to the Client. The Servershall use a null value if any error occurs when a whereClauseis evaluated for a particular Event. If a Value Attributehas an uncertain or bad StatusCodeassociated with it, then the Servershall use a null value instead of the Value.

Any basic FilterOperatorin Table 122may be used in the whereClause, however, only the OfType FilterOperatorfrom Table 123is permitted.

The Servershall validate the whereClausewhen a Clientcreates or updates the EventFilter. Any structural errors in the construction of the filter and any errors which are true for all possible Eventsare returned in the whereClauseResultparameter described in Table 148. Errors that could occur depending on the state of the Serveror the Eventare not reported. Some Servers, like aggregating Servers, may not know all possible EventTypesat the time the EventFilteris set. These Serversdo not return errors for unknown EventTypesor BrowsePaths.

EventQueueOverflowEventType Eventsare special Eventswhich are used to provide control information to the Client. These Eventsare only published to the MonitoredItemsin the Subscriptionthat produced the EventQueueOverflowEventType Event. These Eventsbypass the whereClause.

Table 147defines the EventFilter structure.

Table 147– EventFilter structure

Name

Type

Description

EventFilter

structure

selectClauses []

SimpleAttribute

Operand

List of the values to return with each Eventin a Notification. At least one valid clause shall be specified. See 7.7.4.5for the definition of SimpleAttributeOperand.

whereClause

ContentFilter

Limit the Notificationsto those Eventsthat match the criteria defined by this ContentFilter. The ContentFilter structure is described in 7.7.

The AttributeOperandstructure may not be used in an EventFilter.

Table 148defines the EventFilterResult structure. This is the MonitoringFilterResult associated with the EventFilter MonitoringFilter.

Table 148– EventFilterResult structure

Name

Type

Description

EventFilterResult

structure

selectClauseResults []

StatusCode

List of status codes for the elements in the select clause. The size and order of the list matches the size and order of the elements in the selectClausesrequest parameter. The Serverreturns null for unavailable or rejected Eventfields.

selectClauseDiagnosticInfos []

DiagnosticInfo

A list of diagnostic information for individual elements in the select clause. The size and order of the list matches the size and order of the elements in the selectClausesrequest parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the select clauses.

whereClauseResult

ContentFilter

Result

Any results associated with the whereClauserequest parameter.

The ContentFilterResulttype is defined in 7.7.2.

Table 149defines values for the selectClauseResults parameter. Common StatusCodesare defined in Table 183.

Table 149– EventFilterResult Result Codes

Symbolic Id

Description

Bad_TypeDefinitionInvalid

See Table 183for the description of this result code.

The typeId is not the NodeId for BaseEventType or a subtype of it.

Bad_NodeIdUnknown

See Table 183for the description of this result code.

The browsePath is specified but it will never exist in any Event.

Bad_BrowseNameInvalid

See Table 183for the description of this result code.

The browsePath is specified and contains a null element.

Bad_AttributeIdInvalid

See Table 183for the description of this result code.

The node specified by the browse path will never allow the given AttributeIdto be returned.

Bad_IndexRangeInvalid

See Table 183for the description of this result code.

Bad_TypeMismatch

See Table 183for the description of this result code.

The indexRange is valid but the value of the Attribute is never an array.