Channel Schema The event source you connect to a stream determines the

1-6 Oracle Complex Event Processing CQL Language Reference wlevs:channel id=priceStream event-type=PriceEvent wlevs:listener ref=filterFanoutProcessor wlevs:channel wlevs:processor id=filterFanoutProcessor provider=cql wlevs:listener ref=filteredStream wlevs:processor ...

1.1.1.1.3 Querying a Channel Once the event source, channel, and processor are

connected as Figure 1–2 shows, you can write Oracle CQL statements that make use of the stream. Example 1–4 shows the component configuration file that defines the Oracle CQL statements for the filterFanoutProcessr. Example 1–4 filterFanoutProcessor Oracle CQL Query Using priceStream processor namefilterFanoutProcessorname rules query id=Yr3Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=3_YEAR ]]query query id=Yr2Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=2_YEAR ]]query query id=Yr1Sector[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from priceStream where sector=1_YEAR ]]query rules processor

1.1.1.1.4 Controlling Which Queries Output to a Downstream Channel If you specify more

than one query for a processor as Example 1–4 shows, then all query results are output to the processor’s out-bound channel filteredStream in Figure 1–2 . Optionally, in the component configuration file, you can use the channel element selector attribute to control which query’s results are output as Example 1–5 shows. In this example, query results for query Yr3Sector and Yr2Sector are output to filteredStream but not query results for query Yr1Sector. For more information, see Channel Component Configuration in the Oracle Complex Event Processing Developers Guide for Eclipse. Example 1–5 Using channel Element selector Child Element to Control Which Query Results are Output to a Channel channel namefilteredStreamname selectorYr3Sector Yr2Sectorselector channel You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector. For more information, see Controlling Which Queries Output to a Downstream Channel in the Oracle Complex Event Processing Developers Guide for Eclipse. Introduction to Oracle CQL 1-7

1.1.1.2 Relations

Time varying relation R is a mapping from the time domain to an unbounded bag of tuples to the schema of R. A relation is an unordered, time-varying bag of tuples: in other words, an instantaneous relation. At every instant of time, a relation is a bounded set. It can also be represented as a sequence of timestamped tuples that includes insertions, deletions, and updates to capture the changing state of the relation. Like streams, relations have a fixed schema to which all tuples conform. Oracle CEP supports both base and derived streams and relations. The external sources supply data to the base streams and relations. A base explicit stream is a source data stream that arrives at an Oracle CEP adapter so that time is non-decreasing. That is, there could be events that carry same value of time. A derived implicit streamrelation is an intermediate streamrelation that query operators produce. Note that these intermediate operators can be named through views and can therefore be specified in further queries. A base relation is an input relation. A derived relation is an intermediate relation that query operators produce. Note that these intermediate operators can be named through views and can therefore be specified in further queries. In Oracle CEP, you do not create base relations yourself. The Oracle CEP server creates base relations for you as required. When we say that a relation is a time-varying bag of tuples, time refers to an instant in the time domain. Input relations are presented to the system as a sequence of timestamped updates which capture how the relation changes over time. An update is either a tuple insertion or deletion. The updates are required to arrive at the system in the order of increasing timestamps. For more information, see: ■ Channels Representing Streams and Relations in the Oracle Complex Event Processing Developers Guide for Eclipse ■ Section 1.1.13, Time

1.1.1.3 Relations and Oracle CEP Tuple Kind Indicator

By default, Oracle CEP includes time stamp and an Oracle CEP tuple kind indicator in the relations it generates as Example 1–6 shows. Example 1–6 Oracle CEP Tuple Kind Indicator in Relation Output Timestamp Tuple Kind Tuple 1000: + ,abc,abc 2000: + hihi,abchi,hiabc 6000: - ,abc,abc 7000: - hihi,abchi,hiabc 8000: + hi1hi1,abchi1,hi1abc 9000: + ,abc,abc 13000: - hi1hi1,abchi1,hi1abc 14000: - ,abc,abc 15000: + xyzxyz,abcxyz,xyzabc 20000: - xyzxyz,abcxyz,xyzabc The Oracle CEP tuple kind indicators are: