How to add a second output table to a LiveView Publisher application

How to add a second output table to a LiveView Publisher application

book

Article ID: KB0076050

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10

Description

How can I add a second table output to an existing LiveView Publisher application? 

Issue/Introduction

Design guidance

Resolution

Note: For configuring Recovery see documentation page:
  TIBCO Streaming > LiveView Development Guide > LiveView Data Recovery

This article assumes you have an existing publisher application created using either:
  • a) Right-click on project in the Studio Project Explorer and use context menu: New > TIBCO LiveView Publisher, or
  • b) Right-click on table in the LiveView Project Viewer and use context menu: Add > Publisher
If not, use one of these methods to create a publisher for the target LiveView Table. Creating the initial publisher in these ways creates the schemas and streams needed to support publishing.

In the following steps, replace {tablename} with the name of the new table.

The minimum setup steps are:

1. Right-click the new table in the project's src/main/liveview folder and select context menu:
  StreamBase > Generate LiveView Schemas
This produces in src/main/eventflow/lvinterfaces/ new file {tablename}Schemas.sbint with schemas for *DataIn, *DataOut, *InputControlFields, and *TableSchema.

Note: The "Generate LiveView Schemas" command will fail if the file {tablename}Schemas.sbint already exists in the project lvinterfaces/ folder.

2. In the publisher .sbapp, add the import on the Definitions tab, Manage Module Imports section, lvinterfaces.{tablename}Schemas.sbint.

3. In the publisher .sbapp, add an output stream and name it exactly:
  PublishTo{tablename}Out
and set its Schema to be {tablename}DataInSchema.

4. Connect the new stream to its inputs through a Map which adds:
  Add, *, {tablename}InputControlFields().*
and adjust the remainder of the fields to match the expected {tablename}DataInSchema.