Skip to main content
Question

Iterative loops


I want to implement an iterative loop in my workbench. For this I have created a simple "While Loop" construct. The pseudo code is as below

 

var i, maxval;

 

i = 1;

 

maxval = 10

 

while (i < maxval)

 

{

 

i = i + 1;

 

print i;

 

}

I created a workbench

To implement the looping, the red line should be working but FME doesn't take it.

Please advise for any workarounds or what I may be missing?

4 replies

takashi
Influencer
  • May 16, 2018

Hi @josephjose, to perform iteration, you will have to create a custom transformer. See these links to learn more.

However, in some cases, creating copies of the feature could be enough and also effective, without creating a custom transformer.


  • Author
  • May 17, 2018

Thanks for the feedback.

I read your link

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/transformers_custom_looping.htm

Don't find any option like described like

Right-click in the workspace and choose Insert Transformer Loop, or select the menu Insert > Transformer Loop.

I am using FME2017. Am I ahead of the game or behind?


takashi
Influencer
  • May 17, 2018
josephjose wrote:

Thanks for the feedback.

I read your link

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/transformers_custom_looping.htm

Don't find any option like described like

Right-click in the workspace and choose Insert Transformer Loop, or select the menu Insert > Transformer Loop.

I am using FME2017. Am I ahead of the game or behind?

I have posted two links. Why don't you read the first one - About Custom Transformers? There is another link to "Creating Custom Transformers" which you have to learn first if you want to implement a loop with a custom transformer.

 


  • Author
  • May 17, 2018

Hi Takashi. I got it. Thanks

Wasn't checking it in the custom transformers


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings