Real Time Information Director User Documentation

RTID Extensibility
Hewlett-Packard Company 6 529618 - 001
Delsert or Upsert?
For each inbound native document type, you must establish (and specify in the metadata)
whether to load the data using a delsert or an upsert operation.
If an input document will always contain complete information (i.e., for different
versions of the same document, each new document is a superset of the older versions of
the document), then it is appropriate to delsert the document. Delsert means that the
Director first deletes all existing records related to the current document, then inserts the
current document into the data store.
If the input documents are updates (i.e., newer versions of a document update a subset of
the tables that apply to older versions of the same document), then it is appropriate to
upsert the document. Upsert means that the Director updates any existing records
corresponding to those in the incoming document. If no corresponding records exist,
then new records are inserted.
The mapping information needed for native documents is:
Names of tables that store the document content
Relationships between tables (including whether parent and child records share
the same keys or are linked by a column in the parent record that isn’t a key)
Any requirement for unique keys to be generated by the system
Any requirement for partitioning the data
Note: The Director supports a special kind of table called a historical table, identified
by the term HistoryRecord in the content metadata. The purpose of such a table is to
maintain a historical record of transactions. Thus:
A Delsert will not delete records from a historical table.
The inbound data must contain unique values for the primary key columns of the
historical table.
Creating Native Document Metadata
Once you have the mapping information, follow these steps to create the metadata for a
new native document:
1. Create a new Java class in the package com.hp.rtsc.documents for a supply-
chain application, in the package com.hp.ehr.documents for a healthcare
application, or in a package of your own. Your new class must extend the
NativeDocumentDefinition class. It is conventional, but not required, to name
the class after the document name. For example, if you are creating metadata
for a native INVOICE document, you might name the Java file
“NativeInvoices.java”.