user3165854
user3165854

Reputation: 1655

Loop through for each a set number of times without an array in Mule

I'm using Mule 4 and Anypoint Studio 7.3

I want to use a for each statement which will call a HTTP request a fixed number of times. Can I set the for each to loop through a set number of times e.g. 4 times when the payload is not an array?

Thanks

Upvotes: 1

Views: 2832

Answers (1)

machaval
machaval

Reputation: 5059

You can do that by using the expression #[0 to 9] for example to iterate 10 times

<foreach doc:name="For Each" doc:id="919f04d5-f608-485a-a33b-6a6c2851b6b1" collection="#[0 to 9]">
  <logger level="INFO" doc:name="Logger" doc:id="ed114a04-f0ae-4ab2-8b86-a710ec1cbb8f" />
</foreach>

Upvotes: 2

Related Questions