One Star

[resolved] Trigger workflow after complete Iteration

Hi All,
Maybe this is a really silly question; but I am clueless here and require your expertise.
I have two tFileList components which will work as follows:
tFileList1 ->Iterate -> tFileList2 ->Iterate -> tFileCopy1
Now the question is, once tFileList2 completes the iterations and before it passes the control back to tFileList1 for next iteration, I want to trigger another component. I cant use onComponetOkay as well as onSubJobOk for this requirement.
Bascially I want to copy a particulat file once all copies are done using tFileList2 and before it moves to next iteration of tFileList1
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Trigger workflow after complete Iteration

As I am using Iterate connector, if I use onComponentOk for the second component, it would be invoked after every iteration and also at the end of complete iteration too. I have tried printing tWarn and could find this scenario...

I don't agree with you, let's take the job design as below for example:
tFileList1 ->Iterate -> tFileList2 ->Iterate -> tFileCopy1
|
onComponentOK
|
tJava_1
tJava_1 starts to work only when tFileList_2 complete all the iterations, and before the next iteration of tFileList_1.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
11 REPLIES
Moderator

Re: [resolved] Trigger workflow after complete Iteration

Hi,
Could you please elaborate your case with an example, such as, the source file? your expected result? what your requirement so that we can re-design a new workflow for you.
By the way, please refer to the component reference tFileList with related scenario.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Trigger workflow after complete Iteration

Hi Sabrina,
The exact scenario is as follows:
tFileList1 gets the list of all Directories of a specific pattern
Now, in each directory that it finds, it will contain many tif images as well as one xml file.
So, I need to copy all tiff images first to the destination and once that is complete, I should copy the xml file also to the target. So, XML file works like a flag for the downstream process indicating that the copy is complete.
So, I am finding challenge in determining the end of loop for tFileList2 and then perform a copy of XML file.
Moderator

Re: [resolved] Trigger workflow after complete Iteration

Hi josephmundadan,
So your requirement is that get all the tif image file firstly into your target and then get the only one xml file? It is in order, right?
Please see my scenario: I have many .txt files and only one .xls file in folder 2. I want to copy all the .txt file into my target
folder3 and then copy the .xls file. So my work flow is:
tfilelist1-->tfilecopy1
|
onSubjobok
|
tfilelist2-->tfilecopy2(see my pic)
Is that what you need?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Trigger workflow after complete Iteration

Hi Sabrina,
Thanks for your response. The scenario you had replicated is correct; however there is an additional looping to get the list of folders...
A detailed screen shot is atatched. I have kept all component properties into one single screenshot for quick look.
The main point is, I would still need to access the outer loop's iteration value from an inner loop; hence the iteration should not be breaked, like for example
typically, I would conceptualize something like below:
for (j=0;j<10;j++)
{
for(i=0;i<10;i++)
{
System.out.println(j);//access outer loop's value
}
}
Moderator

Re: [resolved] Trigger workflow after complete Iteration

Hi josephmundadan,
I don't see the "A detailed screenshot", would you mind checking it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Trigger workflow after complete Iteration

Hi josephmundadan,
I don't see the "A detailed screenshot", would you mind checking it?
Best regards
Sabrina

Sorry for the inconvenience. I have now uploaded the screen shot. Thanks for your help...!!!
Community Manager

Re: [resolved] Trigger workflow after complete Iteration

Hi All,
Maybe this is a really silly question; but I am clueless here and require your expertise.
I have two tFileList components which will work as follows:
tFileList1 ->Iterate -> tFileList2 ->Iterate -> tFileCopy1
Now the question is, once tFileList2 completes the iterations and before it passes the control back to tFileList1 for next iteration, I want to trigger another component. I cant use onComponetOkay as well as onSubJobOk for this requirement.

To me, the job design looks like:
tFileList1 ->Iterate -> tFileList2 ->Iterate -> tFileCopy1
|
oncomponentok
|
another component
Why you said you can't use onComponetOk connector?
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Trigger workflow after complete Iteration

Why you said you can't use onComponetOk connector?

As I am using Iterate connector, if I use onComponentOk for the second component, it would be invoked after every iteration and also at the end of complete iteration too. I have tried printing tWarn and could find this scenario...
Community Manager

Re: [resolved] Trigger workflow after complete Iteration

As I am using Iterate connector, if I use onComponentOk for the second component, it would be invoked after every iteration and also at the end of complete iteration too. I have tried printing tWarn and could find this scenario...

I don't agree with you, let's take the job design as below for example:
tFileList1 ->Iterate -> tFileList2 ->Iterate -> tFileCopy1
|
onComponentOK
|
tJava_1
tJava_1 starts to work only when tFileList_2 complete all the iterations, and before the next iteration of tFileList_1.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Trigger workflow after complete Iteration

Thanks a lot Shong... That helped me address the issue... Highly appreciated.
Community Manager

Re: [resolved] Trigger workflow after complete Iteration

Thanks a lot Shong... That helped me address the issue... Highly appreciated.

You are welcome! Thanks for your feedback!Smiley Wink
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business