|
|||||||||||||||||||||||||||||||||
|
Building the NewsTicker Stream
To build the NewsTicker Stream, add a new stream in the same manner as you did above and complete the following the steps:
Table 2. The NewsTicker Stream
Once you build both of the stream objects, EPL Studio should resemble Figure 4. Now that we have some streams, we need to build the event object that will search for the desired data and insert items into the news ticker when it finds what we want.
Creating the Chavez_Alert Event Definition To build the Chavez_Alert, right-click the Event Definitions node in the System pane and select New Event Definition. In the New Event Definition dialog box, enter MLB_News as the Namespace and Chavez_Alert as the Name. Click OK to open the Event Definition editor. A new event, as displayed in the Event Definition tab, only contains the keywords used in an event (ON, WHEN, THEN). Our event will scan the Player stream (ON) and look for news related to Eric Chavez (WHEN). If found, the event will insert a new item into the NewsTicker stream (THEN). To build the event, enter the following text as the Event Definition:
Once you enter the text, choose File > Save System from the EPL Studio file menu. Note, you can also view the EPL that was created for this Event Definition by clicking on the EPL tab of the editor. This action saves all EPL objects to the file system and will make them available when we start the EPL Server in the next section. Start Server and Test Solution Once the server is running, open the EPL Console by selecting Start > [All] Programs > Event_Processor > EPL Console. To test the sample application, complete the following steps:
More Complex Scenarios With a combination of real-time streams and static data (accessed via a Data Adapter), you could combine both current and historical information to put events into context. For example, "Eric Chavez just hit his second home run today…making this game his tenth two-homerun game of the season." Furthermore, you could identify trends across all the data to highlight player trends. For example, "Eric Chavez leads baseball in RBIs and Fielding Percentage. A third baseman has not lead baseball in both of these categories at the same time since 1982." Summary The EPL Console provides you with an easy way to insert test data into a stream and test the system. In a real-world solution you will want to tap into and monitor existing data streams. To do this requires working with Event Processor I/O adapters which we'll cover in a future article.
Page 3 of 3
|
|||||||||||||||||||||||||||||||||
|
Ty Anderson is a partner at Cogent Company, a Microsoft-based consultancy in Dallas that helps organizations use Microsoft technologies to grow their business. Ty is a regular contributor to Devx.com, wrote Office Programming 2003: Real World Applications (Apress), and loves to wear his yellow A's hat.
| |||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||
|