1. Home
  2. Know how
  3. How to Setting MFT flow with FTPS (get) to Mailbox using Regular Expression?

How to Setting MFT flow with FTPS (get) to Mailbox using Regular Expression?

Scenario: We have a producer who uses FTPS (get) connection and posts the data. The producer wants only the files with numbers and ending with xls extension to be allowed. The data has to go through the process which includes archiving the file, performing QA checks, renaming, zipping 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 Mailbox Protocol:

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

Create an application with the FTPS Protocol:

We can go to the Article “Trading Partner – FTPS” 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 Outbound 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 {[0-9]}.xls which is to allow files with only numbers and ending with .xls. 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] }. We can use any kind of regular expressions based on our requirements.

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,renaming, zipping 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.

Now, find the FileRename rule and select Add->

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

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

In the properties, we have the ZipName field. Select the name for the zipped file which is required for this scenario and click on SAVE PROPERTIES button.

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 consumer and Directory as in which path it has to be posted. This will deliver the file into the mailbox specified in the consumer 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