Diplomat MFT Scripting Agent or the API (Application Programming Interface).
How can another application or job stream initiate Diplomat MFT file transfer jobs?
First, set up a transaction in Diplomat Managed File Transfer with the desired filename(s), source directory, destination directory, email addresses, and other parameters. Then, check the Allow Diplomat MFT Scripting Agent requests checkbox in the Job Execution panel on the transaction screen and save the transaction. This setting enables job initiation requests from the Diplomat MFT Scripting Agent.
Can I initiate a file transfer job using a 3rd party application when Allow Diplomat MFT Scripting Agent requests is not checked?
No. If you attempt to initiate a job using the Diplomat MFT Scripting Agent and Allow Diplomat MFT Scripting Agent requests is not checked, the transaction will not be executed and the calling program will receive return code ‘2’.
If I check Allow Diplomat MFT Scripting Agent requests, will other job tasks like email notifications and logging still work?
Yes. A file transfer job set up in Diplomat MFT executes exactly the same way – whether it is initiated by the built-in scheduler or a request from the Diplomat MFT Scripting Agent. Email notifications, archiving of data files, audit trail entries, and all other tasks set up in the Diplomat MFT transaction will be executed for the job.
Where do I install the Diplomat MFT Scripting Agent?
The Diplomat MFT Scripting Agent can be installed on any system that can run Java. For simplicity, many users choose to install the Diplomat MFT Scripting Agent on the same system as the Diplomat MFT Service and then execute it remotely at run time. When the scripting agent is executed remotely, complete pathnames must be used when initiating a file transfer job request and permissions may be needed to access the scripting agent files on the remote system.
How do I initiate a file transfer job when Allow Diplomat MFT Scripting Agent requests is checked?
The execution command and any specific actions to be taken when a file transfer job is successful or fails can be added to any existing job stream. A simple command statement, such as "\\servername\C\Program Files\Coviant Software\Diplomat-j\scriptingAgent\diplomatScriptingAgent.bat" "Outbound to Trading Partner" -server 188.8.131.52, can initiate a file transfer job.
Is there a simple way to manually execute Diplomat MFT file transfer jobs using Diplomat MFT Scripting Agent?
Yes. You can use Diplomat MFT Web Launch to initiate a scripting agent job from a browser. (See the Diplomat MFT Web Launch User Guide for more details.) Or, users can set up a desktop icon that can be used to initiate requests to execute a Diplomat MFT file transfer job using the Diplomat MFT Scripting Agent. The icon would point to a directory containing an executable file with the appropriate Diplomat MFT Scripting Agent command. The target directory field contains an execution command with the appropriate parameters for the specific file transfer job.
NOTE: If the batch file or scripting agent jars being executed are not located on the same system as the desktop icon, a complete pathname needs to be entered as part of the “Target” and “Start in” fields shown above. Always use the -password parameter in the scripting agent command for user authentication in this configuration.
NOTE: No user identity information is captured in the log or audit trail at run-time if the scripting agent jars are not initiated from a Windows system.
NOTE: Configurations that use UNC pathnames rather than mapped drives to identify the location of batch files, jars, or other files may not capture authentication information in the log or audit trail.
What does sampleDiplomatScriptingAgent.bat contain?
sampleDiplomatSciptingAgent.bat is provided as a sample file as part of the Diplomat MFT installation. NOTE: When the scripting agent is not installed on the local system, a complete pathname must be entered in DiplomatSciptingAgent.bat for the DIPLOMAT_HOME directory.
rem DIPLOMAT_HOME Points to the Diplomat install directory - e.g. C:\Program Files\Coviant Software\Diplomat-j.
rem You must edit the definition of DIPLOMAT_HOME, if you have not
rem installed Diplomat in the default directory. If you are executing
rem remotely, enter the complete pathname to the DIPLOMAT_HOME directory –
rem e.g. \\servername\C\Program Files\Coviant Software\Diplomat-j.
set DIPLOMAT_HOME=C:\Program Files\Coviant Software\Diplomat-j
"%DIPLOMAT_HOME%\jre\bin\java.exe" -cp "%SCRIPTING_HOME%\diplomatCommon.jar;%SCRIPTING_HOME%\diplomatScriptingAgent.jar"
diplomat.scripting.ScriptingClient %1 %2 %3 %4 %5 %6 %7 %8 %9
if not errorlevel 1 goto success
if not errorlevel 2 goto invalidArgs
if not errorlevel 3 goto schedFailure
if not errorlevel 4 goto preview
if not errorlevel 5 goto nofiles
if not errorlevel 6 goto execFailure
if not errorlevel 7 goto transactionSuspended
if not errorlevel 8 goto invalidPassword
exit /B 8
exit /B 7
exit /B 6
exit /B 5
exit /B 4
exit /B 3
exit /B 2
exit /B 1
exit /B 0
How does the calling application know the results of a file transfer job?
Diplomat MFT Service provides seven return codes to the calling application to indicate the final status of the job, as follows:
0 – Job was successful
1 – Invalid scripting agent arguments
2 – Transaction failed to get scheduled
3 – Current license is for preview only
4 – No source file(s) found
5 – Job failed during execution
6 – Transaction is currently suspended (Enterprise Edition only)
7 – Password required, but valid password not found
8 – Job completed with status of “Warning”
What log entries are made by the Diplomat MFT Service when a job is initiated by the Diplomat MFT Scripting Agent?
The log entries depend on whether the job was successful or not, as follows:
- When a job fails with invalid arguments (Return Code = 1), then no log entries are made.
- When a job fails because the transaction is suspended (Return Code = 6), the password was not valid (Return Code = 7), or the job fails to get scheduled (Return Code = 2), then a warning message is entered into the log file when the Diplomat MFT Service processes the scripting agent request.
- When a job was successful (Return Code = 0) or failed after it started execution (Return Codes = 3, 4, 5, or 8), then the log entries are the same as for any other file transfer job with the addition of a log entry indicating that the job was initiated by the Diplomat MFT Scripting Agent and a job completion entry indicating the return code for the job.