In the Source Properties list, select symbol. Click on the pull-down menu next to the AS field and select symbol. Click the Plus Sign button. In the Source Properties list, select price. Click the Expression Builder button. Select Aggregate Functions from

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.

The selected source property is added to the Project Expression as Figure 3–61 shows. 3-74 Oracle Complex Event Processing Getting Started Figure 3–61 Select Configuration Dialog: Source Property symbol Selected In this case, we just want to map the source property symbol to output event property symbol as is.

27. Click on the pull-down menu next to the AS field and select symbol.

28. Click the Plus Sign button.

The source property is added to the project expression of the Generated CQL Statement as Figure 3–62 shows. Oracle CEP Samples 3-75 Figure 3–62 Select Configuration Dialog: Source Property symbol Mapped to Output Event Property

29. In the Source Properties list, select price.

The selected source property is added to the Project Expression as Figure 3–63 shows. 3-76 Oracle Complex Event Processing Getting Started Figure 3–63 Select Configuration Dialog: Source Property price Selected In this case, we want to process the source property price before we map it to the output event.

30. Click the Expression Builder button.

The Expression Builder dialog appears as Figure 3–64 shows. Oracle CEP Samples 3-77 Figure 3–64 Expression Builder Dialog

31. Select Aggregate Functions from the Select a function type pull-down menu.

A list of the aggregate functions that Oracle CQL provides is displayed. We are going to use the AVG function.

32. Select the StockVolGt1000.price in the Expression Builder field.

33. Double-click the AVG function.

The AVG function is wrapped around our selection in the Expression Builder field as Figure 3–65 shows. 3-78 Oracle Complex Event Processing Getting Started Figure 3–65 Expression Builder: Applying the AVG Function

34. Click Save.