SFTP Feature of XMDBTool
The SFTP feature in XMDBTool enables you to automate the ftp transfer process of the files, between the Expense Management Application server and the sftp server of the customer.
Else, the sftp process fails and this error is displayed:
This section of the document explains the XMDBTool Import Bkg Process in detail, gets the files from the SFTP server of the customer before doing the import and similarly how the XMDBTool Export Bkg Process transfers the exported files to the SFTP server of the customer.
There are a few parameters that need to be supplied to the bkg process for this to work. This section describes all these parameters and how the process must work:
- sftpHost – This parameter is used to specify the host address of the sftp server.
- sftpUser – This parameter is used to specify the user ID that has to be used to connect to the sftp server specified in the sftpHost parameter.
- sftpPassword – This parameter is used to specify password required to connect to the sftp server
- sftpHostImport – This
is the location of the folder on the sftp server, where the customer is expected to place
all the files that need to be imported to the Expense Management system (cc and
nonCC). Generally, this location is a relative path starting from the user folder. (in
JSCAPE FTP SERVER) For e.g. The folder location for user T1can be:
C:\Program Files\JSCAPE MFT Server\users\admin\T1. (under admin domain) Now the customer can create a folder, import under the T1 user. For example, C:\Program Files\JSCAPE MFT Server\users\admin\T1\import.
So the sftp settings that must be defined on the XMDBTool side are:
sftpHost - customer sftp server ID
sftpUser – T1
sftpPassword - ****
sftpHostImport - /import/
- sftpHostExport - This
is the location of the folder on the sftp server, where the XMDBTool export bkg places all
the exported files from the Expense Management system. Generally, this location is
a relative path starting from the user folder. (in JSCAPE FTP SERVER) For e.g. The folder
location for user T1 can be:
C:\Program Files\JSCAPE MFT Server\users\admin\T1. (Under admin domain) Now the customer can create a folder, import under the T1 user. For example, C:\Program Files\JSCAPE MFT Server\users\admin\T1\export.
So the sftp settings that must be defined on the XMDBTool side are:
sftpHost - customer sftp server ID
sftpUser – T1
sftpPassword - ****
sftpHostExport - /export/
- sftpHostLog – This is the location of the folder on the sftp server, where the XMDBTool import and export bkg places all the log files from the Expense Management system. The customer is expected to create a folder for the import and export logs. This keeps the things organized. The folder location is also relative as the above two folders are created on the sftp server. If for some reason, the customer has not yet created the log folder, the logs are not sent to the customer sftp server. For example: sftpHostLog = /log/
From Expense Management 10.1.3, a new feature is added where logs are sent to a separate SFTP server. To support this feature these additional parameters are added:
- sftpHostForLog - The host SFTP url where the logs files are to be sent.
- sftpUserForLog - The user id of the sftp server where the logs files are to be sent.
- sftpPasswordForLog - The password of the sftp server where the logs files are to be sent.
The above application parameters can also be provided as bkg parameters. The bkg parameters always over-ride the application parameters.
For example, if sftpHost parameter is specified as an application parameter as well as bkg parameter, then the parameter specified by the bkg parameter stake precedence.
In addition to the above six application parameters, these are the two background specific parameters:
- rm – This is a bkg parameter. By default, it is set to true. This parameter decides whether the files that are imported from the sftp server, are removed from the host or not. By default, it's always set to false and the files are not deleted from the sftp host server, once they are transferred to the Expense Management Application server machine. If the files on the sftp server are to be deleted, then the rm must be set to true. Setting it to true, removes the files from the sftp server, after they are transferred to the Expense Management Application server machine .
- sftp – This is also a bkg parameter. By default, it is set to false. When set to false, the bkg does not connect to the sftp server but instead continues with the regular processing and exits. In a normal scenario, if the sftpHost is not provided, either as an application parameter or as a bkg parameter, then the bkg does not try to connect to the sftp server and it will just continue with the regular processing and exits. All bkgs that need to connect to sftp server must have the sftp=true set in its bkg parameter. If this parameter is not specified then the bkg does not connect to sftp server.
With the above knowledge we now dwell into the details on how each import and export bkg process is connected to the sftp server, transfer the files, process them and send back the results to the sftp server.