Click on the SSource icon and drag to the Window icon to connect the Oracle CQL Double-click the Window icon. Configure the Window dialog as follows: Click Save. Click Save Query. Click and drag a Select icon from the CQL Constructs palette and drop it Cl

Oracle CEP Samples 3-69 Figure 3–56 Query Wizard: Window for Moving Average Query

15. Click on the SSource icon and drag to the Window icon to connect the Oracle CQL

constructs.

16. Double-click the Window icon.

The SSource configuration screen appears as Figure 3–55 shows. 3-70 Oracle Complex Event Processing Getting Started Figure 3–57 Window Configuration Dialog: Moving Average Query We want to create a sliding window over the last 2 events, partitioned by symbol.

17. Configure the Window dialog as follows:

■ Select symbol in the Source Property List to add it to the Partition List. ■ Select Partition as the Type. ■ Select Row Based and enter 2 in the Row Based field. 18. Click Add Window. The Query Wizard adds the sliding window to the Generated CQL Statement as Figure 3–58 shows. Oracle CEP Samples 3-71 Figure 3–58 Window Configuration Dialog: After Adding Window

19. Click Save.

20. Click Save Query.

21. Click and drag a Select icon from the CQL Constructs palette and drop it

anywhere in the Query Wizard canvas as Figure 3–56 shows. 3-72 Oracle Complex Event Processing Getting Started Figure 3–59 Query Wizard: Select for Moving Average Query

22. Click on the Window icon and drag to the Select icon to connect the Oracle CQL

constructs.

23. Double-click the Select icon.

The Select configuration screen appears as Figure 3–55 shows. Oracle CEP Samples 3-73 Figure 3–60 Select Configuration Dialog: Source Property symbol Selected

24. Select StockVolGt1000 from the Select a source pull-down menu.

This is the source of moving average query: the view we created earlier see To create a view source for the moving average query: on page 3-43.

25. Select MovingAvgEvent from the Select or Input Event Type pull-down menu.

This is the output event our moving average query will produced. We will map properties from the source events to this output event.

26. In the Source Properties list, select symbol.