Run from a command line

You can use Document Generator from a command line without the graphical user interface (GUI). You do this by running a command with parameters for the test documents you want to create. The command is docGen. Run the tool from the application’s bin directory.

You cannot pause the Document Generator from the command line as you can when using the GUI. Only one Document Generator at a time can be started from the command line in a single DOS window or terminal window.

Note   If you run Activator on Linux and there are spaces in the sender’s or receiver’s ID, we recommend using the Document Generator GUI.

Related topics

Command line parameters

The following table shows the command line parameters for the Document Generator. You do not have to use the parameters in the order listed.

Parameter

Description

Usage

-type

Valid document types are EDI or XML.

Required

-sender

Routing ID of the sender.

Required

-receiver

Routing ID of the receiver.

Required

-outpath

The directory where the Document Generator writes the outbound documents. This is typically the sender’s EDI-out or XML-out directory.

Required

-size

Any value between 1 and 999999 KB to indicate the size of each document you want to create.

Required

-ndocs

Any value between 1 and 999999 to indicate the number of documents you want to create per unit of time. The Document Generator creates all of these documents at once.

Required

-docid

The number to use as the control ID of the first EDI document to be generated.

Do not use for XML documents because they do not have control IDs.

Required for EDI

N/A for XML

-infile

The path to the EDI document on your system that you want to use as the template for generating test documents.

You can use copies of your own EDI document as the test documents rather than the test documents that Document Generator creates for you. If you use your own EDI document as the template, Document Generator copies it and inserts your specified sender, receiver and control ID.

Optional for EDI

N/A for XML

-interval

Any value between 1 and 999999 to indicate the time in minutes the Document Generator waits to create the next document or set of documents.

If you do not use a value, Document Generator creates the number of documents specified by -ndocs once. If you use a value, Document Generator creates the specified number of documents at the specified interval until you stop the tool.

Optional

-maxuncon
sumed

This is a fail-safe control to stop generating documents in the output directory after the trading engine has stopped consuming messages. For example, when the server has stopped running. When the number of unconsumed documents reaches this limit, the utility stops generating documents. This prevents large numbers of unconsumed messages from piling up in the output directory.

Optional

-h, -help or ?

Displays a list of the parameters. (In Windows, see docgen.log in logs directory for list.)

Optional

Command line format

The following are examples for running Document Generator from a command line. Be sure you run the utility from the <Activator install directory>/Activator/bin directory.

Linux

For Linux, the following example shows the command line format for Company1 to create 7 EDI documents that are 3K in size every 5 minutes and place them in the EDI out directory for sending to Partner1. The control ID is 302.

If you run the docGen command without any parameters, the GUI opens.

To stop the generator:

  1. Run ps -ef | grep java to find the process ID (PID).
  2. Run kill -9 [PID], where PID is the number found in the previous step.

Windows

For Windows, the following example shows the proper command line format. Events related to running the tool are written to the docgen.log in the application’s log directory.

Press Ctrl-C in the DOS window to stop the Document Generator.

If there are spaces in the sender’s or receiver’s routing ID or out directory name, place the IDs or directory name in quotation marks so Windows properly handles the spaces.

Related Links