IT Process Automation

Expand all | Collapse all

Is it possible to control the CurrentLoopIteration

Jump to Best Answer
  • 1.  Is it possible to control the CurrentLoopIteration

    Posted 03-20-2019 10:41 AM

    Hi,

     

    I'm trying to change the CurrentLoopIteration value of an operator/loop but I'm getting an error saying that this is not possible because is a system value.

    Does anyone have any tip to do it?

     

    I give you an example of what I'm trying to do:

    I want to loop an operator for 10 times, unless I get a specific result. In this case I want to change the CurrentLoopIteration to 10 to finish the loop.

     

    Regards,

    Sérgio Castro



  • 2.  Re: Is it possible to control the CurrentLoopIteration

    Posted 03-24-2019 10:38 PM

    From the documentation:

    Repeat Count is a calculated field, so you can use a variable or expression to specify the count at run time. Repeat Count accepts the following value types:

    • An integer that defines how many times to loop
    • A Boolean that defines that the loop continues as long as the condition evaluates to true

     

    I would suggest using a condition in the Repeat Count for this.



  • 3.  Re: Is it possible to control the CurrentLoopIteration
    Best Answer

    Posted 04-05-2019 03:18 PM

    This is not how for loop works.

    Your encountering a While loop case

     

     

     

    You need to create an infinite while loop that relies on a boolean flag, as Lindsay_Estabrooks described.

     

    You need an integer Process variable and a boolean Process variable.

     

     

    In each loop iteration, implement this logic :

     

    If specific result is obtained then change flag value

    elseif counter is = to 10 then change flag value