======================================== Hello LiveView Sample ======================================== This is a StreamBase Studio project for LiveView that configures a Server instance with the following: - An ItemsSales table that reflects a live view of sales transactions for a merchant. These transactions have a transactionID and a transactionTime as well as a category attribute. This table is configured in the ItemsSales.lvconf file. - An ItemsInventory table, which is a LiveView-managed aggregate table on the ItemsSales table. This table rolls up Items sold by category and reports the average quantity of items sold and their average price, plus a real-time calculation of the current inventory value based on the last sold price. This table is configured in the ItemsInventory.lvconf file. - An EventFlow application (ItemsSalesDataSource/application.sbapp) that is responsible for sending data into the Items table. This application has a Feed Simulation Input Adapter executing the feed simulation named ItemsSales.sbfs. To run this sample in Studio, you can: - In the LiveView Project Viewer, click the green Run button in the upper right. - Right-click any of the lvconf table configuration files in the Package Explorer view, or right-click the project folder itself, and select Run As > LiveView Fragment. For convenience, a LiveView Desktop workspace is available on the server. After the server is running, use the Studio Program launcher to start LiveView Desktop on the included workspace. The launcher is run from Run > External Tools, under the Program category, titled "Start LiveView Desktop (Hello Sample)". On OS X, the provided Desktop launcher can only locate LiveView Desktop if it is installed in the canonical location under STREAMBASE_HOME/liveview/desktop. Without control, the ItemsSales table would grow without bound, because the sales simulation continuously generates new sales transactions. To counteract this, there is an alert configured that fires when a transactionTime is older then some time expression, which by default resolves to five minutes. The alert has two actions configured, one that publishes a row to the LVAlerts table indicating that a delete has occurred and the other is a delete action. The delete action is configured such that all ItemsSales rows with a transactionTime older then some time expression - four minutes by default - are deleted. This means that the ItemsSales table always has at least the last four minutes of sales data, and at most the last five minutes of sales data. There are two other alert rules configured: - "Ran out of item" This alert rule is configured against the table ItemsSales, such that whenever an item's quantity is zero, the server publishes an alert row. - "Low inventory of an item" This alert rule is configured against the table ItemsSales, such that whenever an item's quantity is less than 30, the server publishes an alert row. To run this sample from the command line outside of Studio, you must: - Package this sample's LiveView fragment project into a fragment archive - Create a separate StreamBase Application project, and set the pom.xml for that project to depend on the fragment archive created in the previous step. - Create a separate StreamBase Application archive file. - Install that archive into a StreamBase Runtime node. - Start the node. These steps are described in more detail in the “Deploy with epadmin” page of the Concepts Overview in the StreamBase documentation. Additional files present in the project: ItemsSalesDataSource.lvconf - registers the ItemsSalesDataSource/application.sbapp file with LiveView. This application starts automatically after all LiveView tables have loaded on startup. ItemsSales.sbfs - a feed simulation that sends a sales feed to the ItemsSales table. lv-interfaces/ItemsSalesDataSource.sbint lv-interfaces/ItemsSalesSchemas.sbint These StreamBase interface (.sbint) files are generated by StreamBase Studio from the information provided in the ItemSales.lvconf file by the LiveView Data Source wizard, and are referenced in ItemsDataSource/application.sbapp. engine.conf - a LiveView configuration file to set up JVM arguments for this sample. More information is available in the LiveView documentation.