Storing CPI Data Via the CPILoader

The CPILoader interface is provided with CPI and can be used to store CPI data. It is a standard batch process as described in the Cúram Batch Processing Guide.

The CPILoader structure requires two parameters to be specified: a log filename and a load filename. The log filename will designate where the log output of the CPILoader run is placed. The load filename must point to an XML file based on the CPIBatchLoader.xsd XML schema. This schema essentially extends the schema used for performing web service calls to the CPIWebService. This allows for the reuse of code on the SOR when generating the CPI Batch Load input file.

The CPILoader was written to leverage the same Applications Programming Interface (API) as is used by the CPIWebService. The Batch Loader consists of a Java class, called CPILoader, which publishes a batch method called loadData(). CPILoader acts as a wrapper for the same Java code that is used by the CPIWebService. Using this approach ensures that data manipulation operations are performed the same way by the Batch Loader as they will be by the Web Service.

CPILoader Structure

The CPILoader XML "input file" must contain a single, root element of type CPIBatchLoad. The CPIBatchLoad element can, in turn, contain one or more CPILoadRecord elements. Each CPILoadRecord consists of a single identifier element (which provides the unique ID and source system identifier for the record being inserted), as well as an insertAttributes element (which will provide the details of the information to be inserted). The insertAttributes element is a complex XML type, and may contain child elements of type Person, Case, Relationship or CaseMember, for example. The insertAttributes XML type is defined within the CPIData.xsd XML Schema File.

Running the CPILoader

The recommended approach for running the CPILoader is to invoke it from the command line of a machine that has had the application installed and setup on it. This is accomplished by running the build runbatch Ant target, and providing the command line parameters previously described. From a command prompt in the EJBServer directory of the installation, perform the following (typing the entire command on a single line):

C:\\EJBServer> build runbatch-Dbatch.program=curam.cpi.external.batch.intf.CPILoader.loadData-Dbatch.parameters="loadFilename=<load-file-location>,logFilename=<log-file-location>"

There are some key points to note when typing this command: