For example, the sample scrip putediexample.txt has the
retryScripts variable set if there are connection problems with the FTP server.
See TIBCO BusinessConnect Services Plug-in User’s Guide, First Tutorial Example for information on
putediexample.txt.
You can control the values returned in the statusCode and
statusMsg fields following script execution. TIBCO BusinessConnect then uses these values for logging.
By default, if job.get("userStatuscode") is not set in the script, it is assumed that the script was executed successfully. Hence, it is not necessary to specify status code 200 in the script for successful execution.
If you have to specify an error, you specify a statusCode other than 200, and an error will be logged and an advisory message on the
Error subject will be sent. To do this, set the variable inside the scripts via the
job slot variable.
You can create an audit log within the context of a script. An audit log object is available as a job slot variable and this object can be used to log, for example, FTP login issues or in a case of inability to delete files due to inadequate file permissions.
The status values are maintained in the Java interface UserLogAccess. The script examples discussed in
TIBCO BusinessConnect Services Plug-in User’s Guide, FTP Script Examples include the
UserLogAccess object which uses the constants to set the status of the audit log entry.
For every execution of the script, a new audit log summary row is created with the first call to the log() method triggering the creation of the row. This method allows the user to define the state, status, and description for the log entry. Please refer the JavaDoc API under
UserLogAccess interface.
The sample script mgetexample.txt (see
TIBCO BusinessConnect Services Plug-in User’s Guide, First Tutorial Example) shows FTP Inbound scripts logging only if there is any error in the execution of the FTP scripts and thereby avoiding filling up the database with this audit trail.