B.1 Simple ContentFilter examples

B.1.1 Overview

These examples provide fairly simple ContentFilters. Filter similar to these examples may be used in processing events.

The following conventions apply to these examples with regard to how Attribute operands are used (for a definition of this operand see 7.7.4):

B.1.2 Example 1

For example the logic describe by ‘(((AType.A = 5) or InList(BType.B, 3,5,7)) and BaseObjectType.displayName LIKE “Main%”)’ would result in a logic tree as shown in Figure B.1 and a ContentFilter as shown in Table B.1. For this example to return anything AType and BType both shall be subtypes of BaseObjectType, or the resulting “And” operation would always be false.

Figure B.1 – Filter logic tree example

Table B.1 describes the elements, operators and operands used in the example.

Table B.1 – ContentFilter example
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0AndElementOperand = 1Element Operand = 4
1OrElementOperand = 2Element Operand = 3
2Equals

AttributeOperand = NodeId: AType, BrowsePath: “.12:A”,

Attribute:value

LiteralOperand = ‘5’
3InList

AttributeOperand = NodeId: BType, BrowsePath: “.12:B”,

Attribute:value

LiteralOperand = ‘3’LiteralOperand = ‘5’LiteralOperand = ‘7’
4LikeAttributeOperand = NodeId: BaseObjectType, BrowsePath: “.”, Attribute: displayNameLiteralOperand = “Main%”

B.1.3 Example 2

As another example a filter to select all SystemEvents (including derived types) that are contained in the Area1 View or the Area2 View would result in a logic tree as shown in Figure B.2 and a ContentFilter as shown in Table B.2.

Figure B.2 – Filter logic tree example

Table B.2 describes the elements, operators and operands used in the example.

Table B.2 – ContentFilter example
Element[]OperatorOperand[0]Operand[1]
0AndElementOperand = 1 ElementOperand = 4
1OrElementOperand = 2ElementOperand = 3
2InViewAttributeOperand = NodeId: Area1, BrowsePath: ".", Attribute: NodeId
3InViewAttributeOperand = NodeId: Area2, BrowsePath: ".", Attribute: NodeId
4OfTypeAttributeOperand = NodeId: SystemEventType, BrowsePath: ".", Attribute: NodeId”