Two List of Files-Actions to get latest TXT-Source-Files / How to proceed further / Worked wrongly with Iterations

Dear all,

I think I have made a mistake in one of my projects and could not figure out how to correct it.

I have two differnt source-folders in which there could be different TXT-Files with a timestamp in the filename; I will need to work with the newest files. So in my so called “Load”-Module I started with two tables “List of Files” and filter them accordingly to get only the newest files.

I then wrongly put “Iteration”-Action to both of the tables calling my “Main”-Module. It took me a little while to find out that this is wrong and could not work.

For the “Main”-Module I will need the two “File name with path” as well as the two “date strings” cout out from the file names to use them in Parameters.

How do I do this correctly?

Best regards,

If I understood you correctly, you are looking to obtain the “date strings” from file names automatically, instead of providing them manually, correct?

If yes, you can use calculated parameters with an expression similar to the one you used for calculating the “date strings” in the “List of files” table.

A calculated parameter is a parameter which value is calculated using an expression that can consist of arithmetical operators, functions and other parameters.

To create a calculated parameter pick “Calculated” when creating a new parameter:

Hi Dmitry,

thanks for your reply; but I think that my problem is more that I have used two(!) iteration actions (one per “List of File”-Table.

This seems to lead to the following (after publish to EasyMorph Server):

  • The parameters “File name with full path” and “File validity string” (for its respective table) are not filled correctly to “Main”-Module; error says that these are completely empty.

  • If I fill the Parameter of the “Main”-Module manually before publishing to the Server its seems to work; but I then always end to a database error complainign about “doubled primary keys”.

I then tought a little while about that phenomenon and came to the conclusion that this happens because of the used two iteration actions: EasyMorph-Server seems to run the main job then twice (which is correct because the iteration actions per table say “Run the module “Main” with all the files listed in my table”; as there a two tables each with one found file the “Main” Module will then be run twice.) Hence the database error about “doubled primary keys” as well as the empty Parameters for main module.

So the “real problem” seems to be: How to avoid that two iteration actions or how to hand over both files f “simultaneously” to the “Main” Module.

Best regards,

In your current workflow the two iteration will execute in parallel, because they are located in independent tables. Try using the “Synchronize” action to make sure that one iteration starts only after the other one finishes.

See this topic: Using Synchronize transformation (and related to it).