======= Managed File Transfer =====
===== General =====
By Managed File Transfer (short [[wp>Managed_file_transfer|MFT]]) we understand the file transfer from point A to point B.\\
Here the communication or exchange can consist of any combination of HDD and FTP.\\
So all permutations of the two variants:
* [[kommunikation:kanal:harddiskreceive|]] to [[kommunikation:kanal:harddisksend|]] or
* [[kommunikation:kanal:harddiskreceive|]] to [[kommunikation:kanal:ftpsend|]] or
* [[kommunikation:kanal:ftpreceive|]] to [[kommunikation:kanal:harddisksend|]] or
* [[kommunikation:kanal:ftpreceive|]] to [[kommunikation:kanal:ftpsend|]].
{{:images:sign_warning.png?nolink|}}**Note:** In addition, eBiss specific methods can be used here, so that a partner recognition based on the paths((See e.g. [[en:kommunikation:kanal:harddiskreceive|Determine partner using subdirectory]].)) and a partner specific((See methods of [[en:howtos:alternative_kommunikation|]].)) forwarding is possible without having to look into the files((The usual procedures of the message recognition and analysis are omitted here completely.)).
===== A possible solution is based on the following components =====
- For each source path - target path combination((by default)) there is a new [[en:partnerverwaltung:start|tradingpartner]] with corresponding [[en:partnerverwaltung:kommunikation:start|communication addresses]] of the type file system, consisting of the directory names.
- The target path is the default address for the send channel ("MFT.Send") and
- the [[en:howtos:mft#hdd_directory_in_this_example|source_path]] for partner detection at the receive channel(("MFT.Receive"))
- To collect these partners in a group, you create a corresponding [[en:partnerverwaltung:start#partnertemplatePartner|template partner]], for which the outgoing communication channel is stored.
- For the files there is a mailbox((referred to as **MFT**)) specially created for this purpose, in which all files end up:
- the messages that cannot be forwarded are directly discarded in a part of a job(("MFT.In")),
- all others are marked as "send" by the send channel ("MFT.Send").
- The receive channel(("MFT.Receive")), which also carries out partner detection based on the source directories, moves the contents of the folders to a subdirectory((here called "Archive" / see HDD directory structure above))
- A file system transmission channel with a corresponding destination path and the setting "Use transmitter address".
- A job("MFT.In")) opens the receive channel("MFT.Receive") and
- discards all files that match the filter specified((For example, here we have filtered all files that do not end in ".txt" or ".xml". In addition, all files coming from "Partner X" will be processed. For this purpose use a [[:en:prozessdefinition:jobs:jobsteps:allgemein:messageselector|MessageSelector]] with the following XPATH expression: /SelectionBase/InputMessages[(substring(Attachments[1]/@Filename,string-length(Attachments[1]/@Filename) - 3) ! = '.xml' and substring(Attachments[1]/@Filename,string-length(Attachments[1]/@Filename) - 3)!= '.txt') and @PartnerName != 'Partner X']
)).
- All files that do not match the first filter will be filtered again in the second step in reverse((This means that the first filter will check again in reverse here. So we only let files with the extension ".xml" / ".txt" or everything from "Partner X" pass. To do this, use a [[:en:prozessdefinition:jobs:jobsteps:allgemein:messageselector|MessageSelector]] with the following XPATH expression: /SelectionBase/InputMessages[(substring(Attachments[1]/@Filename,string-length(Attachments[1]/@Filename) - 3) = '. xml' or substring(Attachments[1]/@Filename,string-length(Attachments[1]/@Filename) - 3)= '.txt') or @PartnerName = 'Partner X']
))
- OPTIONALLY a [[en:howtos:plugins:jobsteps:start|CustomJob Object]] can be triggered((For example, you may want to delete the files copied to the archive after a certain expiration time. For this you need OS functionality that can be scripted in such a Custom-Job-object.))
//All the names for channel / jobs etc. are fictitious//
==== HDD source directory in this example: ====
C:\TEMP\MFT_TEST
├───Partner A
│ └───Archiv
├───Partner B
│ └───Archiv
├───Partner C
│ └───Archiv
├───Partner X
│ └───Archiv
└───Partner Y
└───Archiv
==== HDD destination directory in this example: ====
z:\hostsystem_edi_inbound
├───host1
├───host2
├───host3
├───host4
└───host5
===== Test if the MFT works =====
- Navigate to the desired source path (it is best to create a temporary folder)
- There create some folders with test files (do not create "archive" folders) \\ {{:howtos:mft_test_ordner.png|Example for test folders}}\\ {{:howtos:mft_test_dateien.png|Example for test files}}
- Then start the job that picks up the files and filters them - here "MFT.In"\\ {{:howtos:mft_test_job.png}}
- Check the directory - If everything worked fine, there should be no files in the folders. They should now be in a newly created subfolder "Archive" \\ {{:howtos:mft_test_dateiennachjob.png|Result after successful execution of the job}}