Deploying and Managing Apama Applications > Event Correlator Utilities Reference > Packaging EPL and Java code
Packaging EPL and Java code
The engine_package tool assembles EPL files and .jar files into a Correlator Deployment Package (CDP). You can inject a CDP file into the correlator just as you inject an EPL file or a JAR file containing an Apama Java application. CDP files use a proprietary, non-plaintext format that treats files in a manner similar to the way a JAR file treats a collection of Java files. In addition, using a CDP file guarantees that all files, assuming no errors, are injected and are injected in the correct order. See Injecting code into a correlator for details about how the correlator handles an error in a file that is in a CDP.
While the names of events, monitors, aggregates, and .jar files that are contained in a CDP file are visible to the correlator utilities engine_inspect, engine_manage, and engine_delete, the code that defines them is not.
The executable for this tool is located in the bin directory of the Apama installation. Running the tool in the Apama command prompt ensures that the environment variables are set correctly.
Synopsis
To package files into a CDP file:
*On Windows, run engine_package.exe.
*On UNIX, run engine_package.
To obtain the following usage message, run the command without any options or with the –h option:

Usage: engine_package [ options ] [ file1 [ file2 ... ] ]
In order to create a Correlator Deployment Package (CDP) from multiple files.

Where options include:
-h | --help This message
-V | --version Print program version info
-o | --output <file> Write the CDP to <file>
-m | --manifest <file> Create the CDP from the manifest at <file>
-u | --utf8 Assume input is in UTF-8
Description
The engine_package tool creates a Correlator Deployment Package (CDP). A CDP file contains one or more files. You specify the name of the CDP file to create as an argument to the -o option.
You can specify the files you want to include on the command line or you can use the -m option and specify a manifest file that contains the names of the files. The manifest file is a text file; each line in the file specifies a relative or absolute path to a file. Files should be listed in the order in which you want them to be injected into the correlator.
Options
The following table describes the options you can specify when you package files into a Correlator Deployment Package:
Option
Description
-h
Displays usage information
-V
Displays version information for the engine_package tool.
-o filename
Name of the CDP file to create. Required.
-m filename
Name of the manifest file that lists the files you want to package.
-u
Indicates that input files are in UTF-8 encoding. The default is that the engine_package tool assumes that the files to be packaged are in the native character set of your platform. Set the -u option to override this assumption. The engine_package tool then assumes that all input files are in UTF-8.
Operands
The engine_package tool takes the following operands:
[ file1 [ file2 ... ] ]
The names of the EPL or .jar files that contain code. The order in which these files are specified will become the order in which they are injected into the correlator when the CDP file is injected. Instead of listing the files on the command line, you can list them in a manifest file and use the -m option.
Exit status
The engine_package tool returns the following exit values:
Status
Description
0
On success.
1
On any error.
Example
The following example describes how to create a Correlator Deployment Package file with multiple monitor files and inject the CDP file into a running correlator.
1. Create a manifest file containing a list of files to include in the CDP. For this example, the file is named manifest.txt and each line contains the full path name of an EPL file or .jar file:
c:\dev\sample\monitor1.mon
c:\dev\sample\monitor2.mon
C:\dev\sample\jmon-app.jar
2. To create the CDP file, call the engine_package utility stating the output filename and the manifest file to include in the CDP. (Note, instead of using a manifest file, you can list the files individually in the engine_package arguments.)
engine_package.exe -o c:\sample.cdp -m c:\dev\sample\manifest.txt
3. To inject the CDP file, call the engine_inject utility with -c (or --cdp). This injects each file that is included in the CDP file into the correlator.
engine_inject.exe -c c:\sample.cdp
Sample output from the correlator
2012-07-11 13:51:33.156 INFO [3852] - Injected CDP from file
c:\sample.cdp (b2f097b02791e5dd4ac73cda38e153e9),
size 313 bytes, decoding and compile time 0.00 seconds
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.