I have designed a sequencer with the following steps:
1. Executive command reads comma delimited files from a directory (Ex. A_123.xml B_123.xml C_123.xml)
2. Executive command creates a file with these file names separated by comma delimited (Ex. A_123.xml,B_123.xml,C_123.xml)
3. Pass the file names to a start loop activity, which will process the files in the loop using "List Loop" and Comma Delimited Values that are read from the file created in step 2.
4. Execute Command activity stage is used to extract the first field in the file name before the underscore:
Command used: echo #Start_Loop.$Counter# | cut -f1 -d '_'
Result: A, B, C
5. Job Activity to run desired jobs and the result from step 4 is passed as a parameter into the jobs.
6. End Loop Activity
Code: Select all
Flow:
Execute Command Activity 1 ---> Execute Command Activity 2 ---> Start Loop Activity ---> Execute Command Activity 3 ---> Job Activity --->
End Loop Activity ---> Start Loop Activity
When I run the sequencer it executes properly until the last iteration and then sequencer aborts because "Execute Command Activity 3" (Step 4) returns undesired value.
For instance in the source folder if I have 3 files A_123.xml, B_123.xml, C_123.xml sequencer successfully process the iterations for A_123.xml, B_123.xml and Execute Command Activity 3 after executing cut command it returns value A, B respectively.
But for iteration 3 the Execute Command Activity 3 after executing the cut command returns a Reply of "| cut -f1 -d '_'" instead of "C" this is causing the jobs in the job activity to abort hence the sequencer.
This happens only in the last iteration, if I have 30 files in the source 29 files will be processed and 30th file iteration would be aborted because of step 4.
I am confused why it is an issue with the last iteration when other iterations are get processed. Am I missing something here ?
Please advice.
Thanks !!