FTP Inbound
For FTP inbound operations, the script that is uploaded is executed instead of running pre-defined get or mget operations. During script execution, files are placed in a temporary directory.
To access this property on TIBCO BusinessConnect Container Edition UI:
- Expand Partner Management > Business Agreements > protocol link>Transports tab.
- Select FTP and clicj Edit settings.
- Upload the scripts file in the FTP settings dialog box.
Job Variables
A client interface is available for developing the script and the object implementing the interface is available in the job slot variable.
• ftpObj The slot to retrieve the FTP client object.
Example: var ftpClient = job.get("ftpObj");
In addition, you can use the following job variables in scripts:
• getTmpDir The variable for the temporary directory on the local machine to retrieve files from the FTP server.
Example: var getdir = job.get("getTmpDir");
• hostName The variable containing the trading host name from whom the file came.
Example: var hostName = job.get("hostName");
• logObj The slot variable to retrieve the UserLogAccess object that does audit logging.
• tpName The variable containing trading partner for whom the file is intended to be stored.
Example: var tpName = job.get("tpName");
• ibPGPHandler The variable to be used for inbound PGP un-packaging in an FTP session. Users can use the handler to set the inbound PGP processing policy.
Example: var ibPGPHandler = job.get("ibPGPHandler");
var policy = ... //options: "None", "Must Encrypt", "Must Sign", "Must Sign and Encrypt",
"Pass-through"
ibPGPHandler.setPGPPolicy(policy);
You might also need to set the operation id for the current inbound message:
ibPGPHandler.setOperationID(...);
and then to un-package the received file:
ibPGPHandler.unpackageMessage(filefullname);