A Trading Partner Relationship is used to automate actions based on the receipt of files. This could include internal notifications, processing of received files or simply copying received files to a new location outside of ODEX.
Setting up a TPR in ODEX Plus
- Run the Odexdir to check the ODEX user directory
- If there is no entry for the company using ODEX, press F4 and select "SFID"
- Enter the SFID (this will the same as the SSID code in the ODEXCC.PRM file)
- Select Internal instead of External and press F2 to save
- Enter an "s" character against the internal SFID and press F2 to edit it.
- Set the Validation option to "5", this causes Odex to run a TPR, so one needs to be created.
- Press F2 to save the change, and then F3 to get back to the user directory listing.
- Enter an "r" character against the internal SFID and press F2 to enter the Trading Partner Relationship definitions
- By default there should be nothing defined, press F4 to add a new entry
- The message type needs to be left as * if syntaxed EDI files are being exchanged, or "BINARY" if non-EDI files are being used
- Setting the "Update received file as extracted" flag to Y ensures that the file is marked as processed when copied out of ODEX
- The program to run field can contact any Unix command or script.
- The arguments field can contain any static text or a predefined ODEX placeholder
The most simple example would be:
Program to run
[cp ]
Arguments
[%FTPFILE% ]
[/usr/home/myfiles/ ]
which would copy a newly received file to the "myfiles" directory on receipt.
This TPR is then actioned every time a new file is received. If file matches the criteria specified (usually just EDI or non-EDI), then the program specified is run.
The available placeholders are:
- %SESSID% - Session id
- %FILEID% - File id
- %SSIDORGCODE% - SSID origin code
- %SSIDDESTCODE% - SSID destination code
- %SFIDORGCODE% - SFID origin code
- %SFIDDESTCODE% - SFID destination code
- %VFN% - Virtual file name
- %VFNDATE% - Virtual file date
- %VFNTIME% - Virtual file time
- %FTPFILE% - FTP filename
- %BYTECOUNT% - Number of bytes in the file
- %RECORDCOUNT% - Number of records in the file
- %FILEFORMAT% - File format
- %MSGVERSION% - Message version
- %MSGRELEASE% - Message release
- %MSGTYPE% - Message type
- %UNBORGCODE% - UNB origin code
- %UNBDESTCODE% - UNB destination code
- %INTSTATUS% - Interchange status
- %% - Is replaced with %
The following files are technically EDI, but are treated as non-EDI by ODEX due to their lack of explicit syntax.
- VDA - Predominantly used in the German automotive industry, used by Ford, BMW, VAG etc in Europe.
- GFF - Used by the Inland Revenue for year end submissions (the EDIFACT syntax is also used)
- VQ4 and VQ5 - used by the DVLA to query vehicle ownership.