All Frameworks  Class Hierarchy  This Framework  Previous  Indexes

BatchInfrastructure Class CATBatchParameters

CATBatchParameters
 

Usage: you must use this class as is. You should never derive it.


public class CATBatchParameters

Class generating the batch parameter XML file.
Role: This class allow you to generate the XML parameters file. It can be used in the UI of your batch when overloading the method CATBatchFrame::FillParametersFile One object represents one parameter file. Each method write in the file. To obtain a consistent XML file you must call the methods in the following order :

In the Input or Output section ou can use the Insertxxx methods to describe the I/O of your batch.
See also:
CATIBatchCAA, CATIBatchElementsCAA, CATBatchParameters, CATBatchFrame (for CATUTIL integration only)


Constructor and Destructor Index


o CATBatchParameters()
o ~CATBatchParameters()

Method Index


o BeginBuffer(char*,char*,char*,char*,char*,char*,char*)
Initialize the XML input parameter file and generate the root tag
Role: This method allows you to initialize an XML parameter file.
o BeginInput()
Opens a Input section.
o BeginOutput()
Opens a Output section.
o EndBuffer()
Closes the XML input parameter file
Role: This method close the XML input parameter file.
o EndInput()
Closes a Input section.
o EndOutput()
Closes a Ouput section.
o GetFullPath(CATUnicodeString&)
Retrieves the full path of the current XML parameter file.
o GetOutputParamFile()
Retrieves the current output parameter within a batch.
o GetOutputParamPath(CATUnicodeString&,char*)
Retrieves the path of the output XML file.
o InsertFile(char*,char*,char*,CATComFileType,CATBatFileUploadable,int)
Inserts a <file> tag in your XML file.
o InsertFolder(char*,char*,char*,CATComFileType,char*,CATBatFileUploadable,int)
Inserts a <folder> tag in your XML file.
o InsertSimpleArg(char*,char*)
Inserts a <simple_arg> tag in your XML file.
o InsertTag(char*)
Inserts a custom string in your XML file.
o InsertUTF8Tag(char*)
Inserts a custom string in your XML file.

Constructor and Destructor


o CATBatchParameters
public CATBatchParameters()
o ~CATBatchParameters
public ~CATBatchParameters()

Methods


o BeginBuffer
public HRESULT BeginBuffer( const char* batch_name,
const char* file_name,
const char* user=NULL,
const char* pwd=NULL ,
const char* env=NULL,
const char* dir=NULL,
const char* licfile=NULL)
Initialize the XML input parameter file and generate the root tag
Role: This method allows you to initialize an XML parameter file.
o BeginInput
public HRESULT BeginInput()
Opens a Input section.
Role: This method open the input section of your XML parameter file where you can describe the inputs of your batch. Do no forget to call EndInput to close the section.
o BeginOutput
public HRESULT BeginOutput()
Opens a Output section.
Role: This method open the output section of your XML parameter file where you can describe the outputs of your batch. Do no forget to call EndOutput to close the section.
o EndBuffer
public HRESULT EndBuffer()
Closes the XML input parameter file
Role: This method close the XML input parameter file.
o EndInput
public HRESULT EndInput()
Closes a Input section.
Role: This method close the input section of your XML parameter file if it has been previously opened.
o EndOutput
public HRESULT EndOutput()
Closes a Ouput section.
Role: This method close the output section of your XML parameter file if it has been previously opened.
o GetFullPath
public HRESULT GetFullPath(CATUnicodeString& full_path)
Retrieves the full path of the current XML parameter file.
Role: This method retrieves the full path of the current XML parameter file.
o GetOutputParamFile
public static CATBatchParameters* GetOutputParamFile()
Retrieves the current output parameter within a batch.
Role: This method must be used in your batch if you need to descibe its output while it's running. Useful only if you don't know these outputs from the XML parameter file.
o GetOutputParamPath
public static HRESULT GetOutputParamPath(CATUnicodeString& oPath,
char* uuid)
Retrieves the path of the output XML file.
Role: This method allows you to retrieve the path of the output XML file in a batch or even in the launcher process?
Parameters:
uuid
the uuid identifying the batch, retrieved by CATBatClientMonitorCAA::StartV5Batch method
oPath
the path of the output XML file
o InsertFile
public HRESULT InsertFile( const char* id,
const char* filePath,
const char* dest,
CATComFileType type,
CATBatFileUploadable fupload,
int automatic= 1)
Inserts a <file> tag in your XML file.
Role: This method allows you to describe a file typed I/O.
Parameters:
id
Name for your tag, useful for an easy access from your batch using "ParametersCAA" methods. See CATIBatchElementCAA
filePath
Absolute file path of your file.
dest
Used for remote execution of your batch. Can be set to NULL for local execution or in remote only if "automatic" is set to 1. See below. Two cases
  • For an input (InsertFile called in the intput section) : "dest" represents the directory where the file is to be uploaded on the remote machine before the batch execution
  • For an output (InsertFile called in the output section) : "dest" represents the directory where the file is to be downloaded on the local machine after the remote batch execution
type
type of the file (for remote execution only) Legal Values:
  • COMM_FILE_ASCII : for a text file
  • COMM_FILE_BINARY : for a binary file
fupload
download/upload mode (for remote execution only). Unique Legal Value supported:
  • CATBatchRightNow
automatic
used in remote only to determine the behaviour of "dest" (see above). If automatic = 0 means that in remote you have specify the directory "dest" yourself as explained above. If automatic = 1 means that you don't need to specify "dest" for a remote exection. The following rules will the be applied :
  • For an input "dest", the upload directory target, will be a temporay directory on the remote machine
  • For an output "dest", the dowload directory will be equal to"filePath"
The automatic mode is useful when you don't want to reference any specific target on the remote machine and then be able to run your batch anywhere.
o InsertFolder
public HRESULT InsertFolder( const char* id,
const char* folderPath,
const char* dest,
CATComFileType type,
const char* extension,
CATBatFileUploadable fupload,
int automatic= 1)
Inserts a <folder> tag in your XML file.
Role: This method allows you to describe a folder typed I/O.
Parameters:
id
Name for your tag, useful for an easy access from your batch using "ParametersCAA" methods. See CATIBatchElementCAA
folderPath
Absolute path of your folder.
dest
see InsertFile method
type
type of the file contained in your folder (for remote execution only) Legal Values:
  • COMM_FILE_ASCII : for a text file
  • COMM_FILE_BINARY : for a binary file
extension
extension of the files in your folder (without the dot).(for remote execution only)
fupload
download/upload mode (for remote execution only). Unique Legal Value supported:
  • CATBatchRightNow
automatic
see InsertFile method
o InsertSimpleArg
public HRESULT InsertSimpleArg( const char* id,
const char* value)
Inserts a <simple_arg> tag in your XML file.
Role: This method allows you to describe a simple typed I/O : int, double To be retrieved in your batch using the BoolArg, FloatArg, StringArg methods of CATIBatchElementCAA, depending of the type of your input.
Parameters:
id
Name for your tag, useful for an easy access from your batch using "ParametersCAA" methods. See CATIBatchElementCAA
value
value of your I/O
o InsertTag
public HRESULT InsertTag( const char* tag)
Inserts a custom string in your XML file.
Role: This method allows you to write a sting in the XML file. This is to be used to insert your own tags and syntax. This string must be XML.
Parameters:
tag
The string to be written in the XML file
o InsertUTF8Tag
public HRESULT InsertUTF8Tag( const char* tag)
Inserts a custom string in your XML file. Warning this tag won't be converted to UTF8 If you need UTF8 conversion please use InsertTag
Role: This method allows you to write a sting in the XML file. This is to be used to insert your own tags and syntax. This string must be XML.
Parameters:
tag
The string to be written in the XML file

This object is included in the file: CATBatchParameters.h
If needed, your Imakefile.mk should include the module: CATBatchUtils

Copyright © 2003, Dassault Systèmes. All rights reserved.