Using the packagemodel Command

Use the packagemodel command to combine a model file, its event handler files, and its configuration information into a single distributable file, the model package. Sensitive information included with the model package, such as password lists, can be encrypted.

About the Command

While everything contained within a model package relates to a single model, that model can be deployed to several servers, each with a different configuration, such as different session pool parameters and model variables. The packagemodel command is what you use to create the model package. To activate the model package, use the activatemodel command.

Command Requirements

Before you use the packagemodel command, you must create all necessary files:

A sample directory structure:

sample directory

The packagemodel command can be executed from any folder, as long as <VHI install folder>\bin is in your PATH.

Command Syntax

Here's the syntax for the packagemodel command:

packagemodel -model model_file
[ -package output_package_file ]
[ -mvl mvl_descriptor ]
[ -passphrase encryption_passphrase ]

 

Option Short Version Required Description
-model -m X The model you want to package for deployment. The value for this option can either be a model file "modelname.model", or a model directory name "modeldir" containing a model file of the same name "modeldir.model". The path specified can either be fully qualified or relative to the current working directory. This switch is required.

If a subdirectory named "deploy" exists in the model directory, it is automatically searched for configuration descriptors. Specifically, if a file named "deploy_desc.xml" exists, it is assumed to be a configuration descriptor and included in the package. If a configuration descriptor was found, and a file named "mvl_desc.xml" exists, it is assumed to be a model variable list descriptor and included in the package.

If a subdirectory named "scripts" exists in the model directory, the model is assumed to use event handling. All JAR files (Java) or assembly files (.NET) are found in the "scripts/lib" folder are included in the package.

-mvl -l

 

Specifies the location of a variable list descriptor file. While any model variable list descriptor named "mvl_desc.xml," located in the "deploy" directory, is automatically included in the model package, there may be circumstances where a model variable list is shared between multiple models. The use of this switch allows the administrator to override the default behavior and explicitly specify a model variable list descriptor file to package with the model. The path specified can either be fully qualified or relative to the current working directory. This switch is optional.
-package -p

 

This switch specifies the file name of the created model package. The file name specified can either be fully qualified or relative to the current working directory. This switch is optional. By default, the model package is named "modelname.zip" and placed in the current working directory.
-passphrase -e

 

This switch specifies a pass phrase used to generate an encryption key for encrypting sensitive data contained within the model package. Specifically, the values of any variables marked as "hidden" within the configuration descriptors are encrypted. This switch is optional.

By default, encryption is not used. The phrase specified should either be a combination of eight or more random characters or a word phrase of five or more words. Spaces are significant; if they are used, the phrase should be placed in quotes.

packagemodel Command Examples

The first command creates a package file for MyModel called MyPackage.zip and places it in the current working directory, which is the model directory. If a subdirectory named deploy exists in the model directory, it is searched for the descriptor files deploy_desc.xml and mvl_desc.xml. If these files exist, they are assumed to be the configuration and model variable list descriptor files and they are included in MyPackage.zip. You can also identify the model you want to package by using the -m or -model switch to specify the model directory instead of the actual model file.

packagemodel -model MyModel -package MyPackage.zip

The next command is equivalent, except it uses the model variable list descriptor file MyModelMVL.xml instead of deploy\mvl_desc.xml:

packagemodel -model MyModel -package MyPackage.zip -mvl MyModelMVL.xml

The final command uses short versions of the switches (for example, -m instead of -model) and uses the password phrase "In sequent toil all forwards do contend" to generate an encryption key for sensitive data contained within the model package. This means that variable values in the descriptor files that are marked "hidden" are encrypted:

packagemodel -m MyModel -p MyPackage.zip -l MyModelMVL.xml -e "In sequent toil all 
forwards do contend"
Related Topics
Bullet Deployment Overview
Bullet Using Commands to Deploy a Model Package
Bullet About Model Packages