Real Time Information Director User Documentation
RTID Metadata Language
Hewlett-Packard Company 77 529618-002
The Enrichment Class
The Enrichment class, Enrichment.java, includes methods for initialization and for
implementing inbound, outbound, top-down, and bottom-up enrichments. For
information about the syntax for invoking these methods, see the Javadoc for the class
Enrichment.java.
The first step in creating an Enrichment is to create a constructor that defines the
parameters. These parameters can be strings, or immutable or singleton objects. (For
background on the characteristics and use of “immutable” and “singleton” object, see a
reference on object-oriented programming concepts.)
The EnrichedRecord Class
The EnrichedRecord class associates enrichments with a particular table. To facilitate
reuse, it makes sense to define an EnrichedRecord, not within a document definition, but
in a separate class, such as the EHR.java class in the EHR sample application.
The EnrichedRecord constructor requires the table name and an Enrichment or array of
Enrichments, as illustrated in the code examples in “Partitioning Tables,” above.
The enrich method of the EnrichedRecord class produces another EnrichedRecord.
For information about the syntax of the EnrichedRecord class, see the Javadoc for
EnrichedRecord.java.
Understanding Groups
The most important new concept you need to understand to write enrichments is the
concept of a group, because a custom Enrichment always takes a Group as one of its
parameters and almost invariably invokes methods of the Group class.
A Group corresponds to a unique record that is stored in one or more tables. (The same
record can be stored in multiple tables if the record is split horizontally.) Groups form a
hierarchical tree, reflecting the hierarchical relationships in the XML document and the
one-to-many associations between tables in the data store. A single Group at the top
level in the hierarchy represents the subject of the document and has the name of the top-
level table affected by the document. This top-level group corresponds to the
DocumentRecord. Groups lower in the hierarchy are called child groups and have the
names of other tables affected by the document.
The Group object has methods that let you operate on the data in individual Groups or
even alter the Group hierarchy by adding or removing records.
For information about methods of the Group class, see the Javadoc for the class
Group.java.