Click and drag the Pattern Match Template from the Templates palette and drop it Double-click the SSource icon. Configure the SSource as follows: Enter the following expression in the Pattern Expression field: Select orderid from the Partition By pull-dow

Oracle CEP Samples 3-25 Figure 3–9 Template Tab

10. Click and drag the Pattern Match Template from the Templates palette and drop it

anywhere in the Query Wizard canvas as Figure 3–9 .

11. Double-click the SSource icon.

The SSource configuration screen appears as Figure 3–35 shows. 3-26 Oracle Complex Event Processing Getting Started Figure 3–10 SSource Configuration Dialog The source of our query will be the orderChannel stream.

12. Configure the SSource as follows:

■ Select Stream as the Type. ■ Select orderChannel from the Select a source pull-down menu. 13. Click Save. 14. Click Save Query. 15. Double-click the Pattern icon. The Pattern configuration screen appears as Figure 3–11 shows. Oracle CEP Samples 3-27 Figure 3–11 Pattern Configuration Dialog: Pattern Tab Using the Pattern tab, we will define the pattern expression that matches when missed events occur. The expression is made in terms of named conditions that we will specify on the Define tab in a later step.

16. Enter the following expression in the Pattern Expression field:

CustOrder NoApproval? Shipment This pattern uses the Oracle CQL pattern quantifiers that Table 3–3 lists. Use the pattern quantifiers to specify the allowed range of pattern matches. The one-character pattern quantifiers are maximal or greedy; they will attempt to match the biggest quantity first. The two-character pattern quantifiers are minimal or reluctant; they will attempt to match the smallest quantity first. For more information, see: ■ PATTERN Condition in the Oracle Complex Event Processing CQL Language Reference ■ MATCH_RECOGNIZE Condition in the Oracle Complex Event Processing CQL Language Reference Table 3–3 MATCH_RECOGNIZE Pattern Quantifiers Maximal Minimal Description ? 0 or more times + +? 1 or more times. ? ?? 0 or 1 time. 3-28 Oracle Complex Event Processing Getting Started

17. Select orderid from the Partition By pull-down menu and click the Plus Sign

button to add this property to the PARTITION BY clause. This ensures that Oracle CEP evaluates the missing event query on each order.

18. Enter Orders in the Alias field.