1. Home
  2. Know how
  3. How to Setting MFT flow from SFTP to Mailbox using Regular Expression?
  1. Home
  2. Videos
  3. How to Setting MFT flow from SFTP to Mailbox using Regular Expression?

How to Setting MFT flow from SFTP to Mailbox using Regular Expression?

Scenario: We have a producer who uses SFTP connection and pushes the data. The producer wants only the files with alphabets and ending with txt extension to be allowed. The data has to go through the process which includes archiving the file, performing QA checks, translating using a map, renaming the file, and then delivering to the consumer who uses the Mailbox protocol.

The step by step procedure on how to set up is explained below

Create a Producer with the SFTP Protocol.

We can check the “Trading Partner – SFTP” Article on how to create a producer/trading partner with the SFTP protocol.

Create an application with the Mailbox Protocol.

We can go to the Article “Trading Partner – Mailbox” to know how to create an application using the Mailbox protocol.
Please note that the process for creating trading partner and application are almost similar.

Build Data Flow

Once the trading partner and application are created, go to Data Flows -> Build Data Flow. Now, select the created trading partner and application and click Setup Workflow

Select the Inbound Tab. Note: By default, the Inbound will be in selection.

Now, input the MFT details based on the partner requirements. In our scenario, the filename can be any alphabets and ends with txt extension.

We can give the regular expression based on our requirement in the File Name text box. In our case, we use {[A-Z][a-z]}.txt which is to allow files with only alphabets and ending with .txt. Once it is filled, we can click on Add.

Based on the requirement, we can give the regular expression. e.g. If we want to allow only files with numbers or capital alphabets, we can give the regular expression as { [0-9] | [A-Z] }.

If we want to modify the created process, we can click on edit and this brings the details on the text box at the left. We can modify the values and select Update.

Apply Rules and Provide Properties:

  • Based on the requirements, we have to add the rules. In our scenario, the process involves archiving the file, performing QA checks, translating using a map, renaming the file, and delivering to a consumer.

    Once we click on the Rules, it will give us the option of including the Rules.

Now, we have to just select the rule as per our scenario. Look for the SourceFileArchive on the left side, select it and click on Add->.

It will open a popup with the text box, where we can add the properties. In our case, if the file has to be archived in location D:/archive with the prefix as archive_, date timestamp as yymmdd format and extension as .arc, we need to fill those details in the text box provided in the properties dialog and click on Save Properties. Once it is saved, we can close it.

This adds the SourceFileArchive rule into our process.

Now, we have to select the QAChecks and click on Add->.

In the popup, include the properties based on our requirement. In this case, the QA check is performed by checking the filename, client code and size_max with the data provided in the rule properties.

Next, select the Translation rule and click on Add->.

In the properties, we have the MapName field. Select the map which is required for this scenario and click on SAVE PROPERTIES button.

Now, find the FileRename rule and select Add->

Include the required details in the properties as per the requirement and save it.

Finally, select the DropProcess rule and select Add->

In the properties, select the protocol as per our scenario which is Mailbox and ProtocolReference as our application and Directory as in which path it has to be posted. This will deliver the file into the mailbox specified in the Application in the directory mentioned in the rule property.

Now, we are done with the required rules.  The applied rules will now appear on the right side. We can now hit the Save Workflow.

That’s it. We are now all set and the workflow for the scenario is created successfully.

Updated on August 4, 2019

Was this article helpful?

Related Articles

Leave a Comment