Running a Batch from CATBatchStarter

If you already have an XML file containing all the required inputs, you can use this parameter file to run a batch from the command line. CATBatchStarter lets you run a batch through the command line with a list of options, like you do it with the CATUTIL command.

Using CATBatchStarter or CATUTIL for running a batch gives the same result. The main difference between these two commands is that CATBatchStarter lets you add a list of options whereas CATUTIL lets you use the -Name option only.

  1. Open the default installation folder: C:\Program Files\Dassault Systemes\Bn\OS_a\code\bin

    Where n is the current release number.

  2. Run the following command (this scenario uses two options but you can use more if required):

    CATBatchStarter -input xml_file -output folder

    Where xml_file is the path and name of the XML file and folder is the output's storage location.

    For instance:

    CATBatchStarter -input e:\users\my_parameters.xml -output e:\users\output

    Tip: You can modify the default storage location of these files by exporting the BATCH_HOME variable, provided that the option is not defined:

    set BATCH_HOME=new_path

    Where new_path is the path of the new storage location.

    Below are the various options that you can use when running CATBatchStarter:

    Option Description
    -input Specifies the name and path of the XML parameter file.
    -host Specifies the name of the remote computer when running a batch in remote mode. The parameter file must contain the license information, otherwise the batch execution fails.
    Important:
    • A batch monitor's server process must run in the remote computer.
    • The default environment used to run the batch is the batch monitor's server process environment.
    • The options used to run the batch are those referenced by the batch monitor's server process environment.
    • If you upload, create, or modify Version 5 documents on the remote computer, the links between documents are not kept.
    • If you open Version 5 documents through the network with the remote computer, these documents and all their pointed documents used by the batch must be visible and accessible by the remote computer.
    -driver Specifies the communication driver. By default, it uses the backbone driver (BB) but you can use an MQ driver. When running the batch in local mode (that is, no -host option), the communication driver is always BB and in that case, the -driver option is ignored. For more information, see Batches.
    -output Specifies the directory for the batch log. By default, it is in c:\temp.
    -verbose Displays information about the batch execution in the standard output.
    -h Displays a short help message.
    -allow_visu Runs batches that require a graphic adapter. If you try to run a batch requiring a graphic adapter without this option, the return code is "7".
    -lic_setting Specifies that you use the licenses defined through Licensing preferences.
    -args Specifies the arguments used with the batch main function (int argc, char** argv). This option must be in the last position in the command line.

    Not all these options are mandatory but if you want to use them all, the command line looks like this:

    CATBatchStarter -input parameter file [-host hostname] [-driver MQ/BB] [-output directory] [-verbose] [-h] [-allow_visu] [-lic_setting] [-args arg1 arg2 arg3]

    Bear in mind that you must specify licenses, whether in an XML parameter file, or through the -lic_setting option.

    To specify licenses through the XML file, you can use the licfile tag to indicate the full path of a file containing the license configuration. Format this file as follows:

    BatchName|Lic1.prd|lic2.prd

    Where BatchName is the name of the batch as given in the XML descriptor file and Lic1 and Lic2 are the requested licenses. For example:

    Export3DXML|MDE.prd. You can use this file to specify the licenses requested for several batches. In this case, write one line per batch:

    batch1|conf1.slt batch2|conf2.slt

    Important: Batches cannot use Shareable licenses granted during the session through Me > Preferences.

  3. To verify if the batch executed correctly, open the c:\temp\ folder.
    A .txt file named "BatchMonitorResults_" suffixed with the hour at which the batch was run. For example, "BatchMonitorResults_8.46.34.txt" gives you information on the batch execution. It also indicates the folder where the reports generated by the batch execution are stored.
  4. To read the reports generated by the batch execution, open the e:\users\output folder.
    Three files are created:
    • A report in text format named batchIDLOG.txt.
    • A report in XML format named batchIDLOG.xml.
    • A log containing the output named batchIDOUTPUT.xml.

    Where "batchID" is the number identifying the batch.

    You can modify the default storage location of these files by exporting the following variable:

    set BATCH_HOME=new_path

    Where new_path is the path of the new storage location.

    Warning: SelectHelp > Batch Monitor Help in the Batch Monitor, or click in the upper-right corner of the selected batch interface to display information about the selected batch, or the Batches page.