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. Access 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 detailed the various options you can use when running CATBatchStarter:

    Options Use
    -input Specifies the name and path of the XML parameter file.
    -host Used when running a batch in remote mode to specify the name of the remote computer. Using this option means that the parameter file contains the license information, otherwise the batch execution fails. Be aware that:
    • 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 Version 5 documents are uploaded, created, or modified on the remote computer, the links between documents are not kept.
    • If Version 5 documents are accessed through the network by the remote machine, 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 Lets you run batches requiring 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 the licenses defined through Licensing preferences are used.
    -args Lets you specify 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: Shareable licenses granted during the session through Me > Preferences cannot be used by batches.

  3. To check if the batch executed correctly, access the folder c:\temp\.
    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, access the folder e:\users\output.
    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: Selecting Help > Batch Monitor Help in the Batch Monitor, or clicking the button in the upper-right corner of the selected batch interface displays either information about the selected batch, or the Batches page.