|
[this page is a work in progress] This page describes how to configure and run the “Fast Flower Delivery” application using the ruleCore CEP Server. The Fast Flower Delivery demo application is used as an example in the book "Event Processing in Action" by Opher Etzion and Peter Niblet. The ruleCore CEP Server solution to the Fast Flower Delivery application consists of a set of rules, grouped into three distinctive groups. Each group deals with a certain aspect of the application; initialization of the delivery process, supervising the process and maintaining driver rankings. ruleCore CEP Server, intro All interaction with the ruleCore CEP Server is done through the use of events. The server consumes and produces two classes of events, system and user events. Inbound system events are events that updates or queries the setup of the server (event types, rules, situations, views etc). Inbound user events are events that report that something has happened or been observed (a door was opened, new location of vehicle, temperature reading). Outbound system events normally come in response to inbound system events, telling that the system setup has been changed (new rule, deleted view etc.) or that a particular change could not be made. Outbound user events come as a result of a triggered rule, i.e. a situation was detected or a situation was considered undetectable. All events sent to or received from the ruleCore CEP Server follow a specific format, the ruleCore event format . A ruleCore event, in short, contains the following: - an event type
- a globally unique event ID
- an event timestamp
- an event class (defaults to user)
- a header section with extra metadata; credentials, causality info etc.
- a body section containing the user generated event payload
Running the demoThis section outlines the procedure of setting up and running the FFD demo. Demo Instance The FFD demo may be run using a public demo instance of ruleCore. The instance can be accessed using JMS using the following connection parameters: - URL: tcp://212.214.20.188:6116 (ActiveMQ 5.3 broker)
- Inbound, user/system event queue: ffd_InputEvents
- Outbound, user event queue: ffd_OutputEvents
- Outbound, error event queue: ffd_ErrorEvents
Setting up the demo
Basic configurationThe basic configuration part sets up the core part of the FFD demo rule set. This means everything that is of the generic kind and not specific to any Store or Driver. The configuration events needed to do this are located in the setupbasic folder of the "Basic setup/teardown" event package (see the Downloads section below). There is also a file named setup_event_order.txt in this folder containing an ordered list of event filenames. The events should be sent to the server in this order. Store/driver specific configuration (example)This sets up a small test of the FFD demo rule set. This means everything that is specific to stores and drivers. More precisely, this sets up; the list of manual/automatic assignment stores, the store geographical regions and rules/views needed for the stores. The configuration events for this part are located in the setupextra folder of the "Basic setup/teardown" event package (see the Downloads section below). There is also a file named setup_event_order.txt in this folder containing an ordered list of event filenames. The events should be sent to the server in this order. This set of event files are a good starting point when building your own test cases. Below is a description what needs to be done when adding stores and drivers to a test case. Each store X need its own copy of the following configuration events, substitute X with the actual name of the store; - change the zone name to name of store
- assign a unique id to the ZoneDef
- insert a Polygon (with series of coordinates) or Circle (center + radius) section, describing the shape of the store's geographical region
- RuleCreateBidRequestStoreX.xml
- change the rule name to CreateBidRequest_StoreX
- update the Initialize expression; let the Zone value refer to the id of the store's ZoneDef
- change the view reference to CreateBidRequest_StoreX
- ViewCreateBidRequestStoreX.xml
- change the rule name to CreateBidRequest_StoreX
- update the Assert expression; let the Zone value refer to the id of the store's ZoneDef
- OnlineCreateBidRequestStoreX.xml
- change the rule name to CreateBidRequest_StoreX
The ListAutomaticAssignmentStore.xml needs to updated if the assignments should be made automically for the store. Otherwise, if it should be done manually, update the ListManualAssignmentStore.xml with the name of the store.
Each added driver needs to have at least an initial value for the Ranking property. This is made by creating a file EntityInstanceDriverX.xml containing initial values (CreateEntity event) for this Driver instance. Tearing down To delete the current setup and start over from scratch, a set of teardown events are sent to the ruleCore CEP server. Configuration events are provided for both the basic and the store/driver specific parts and they are located in the teardownbasic and teardownextra folders of the "Basic setup/teardown" event package (see the Downloads section below). There is also a file named teardown_event_order.txt in each of these folders. The file contains an ordered list of event filenames. The events should be sent to the server in this order. Running the demo/test case To actually run a demo or test case just send the various user events at your own liking, i.e. locations of drivers, delivery requests/bids, manual assignments and pickup/delivery confirmations. There is a small set of example user events provided to get you started (see the Downloads section below). The events match the example config mentioned in the setup section above. To customize the set of events for your own test cases, use the example events as template and copy/edit them as necessary to match your specific test configuration and user event flow. Downloads To simplify posting of events, we have provided a small utility. It is called SendEvent and can be downloaded and read more about from here. Document descibing all rule configuration events:
flower-use-case-rc-implementation-0-13.pdf
Document containing an overview of the rules and the event flow: flower-use-case-rules-overview-0-13.pdf
Download the rule definitions/config and a set of input events which can be used for testing:
|