Reputation: 168
Having no luck trying to access the FOREACH_COUNTER value within a ForEach Mediator as indicated in the specification ForEach Mediator Doc
I am trying to get the counter of the loop currently being performed and use that count in the sequence being executed.
Has anybody been able to retrieve the property?
Upvotes: 2
Views: 1559
Reputation: 265
Name of properties FOREACH_COUNTER and FOREACH_ORIGINAL_MESSAGE also should be prefixed by ForEach ID and underscore. For example:
<foreach expression="//inline/a" id="Loop">
<sequence>
<log>
<property expression="get-property('Loop_FOREACH_COUNTER')" name="Step"/>
<property expression="get-property('Loop_FOREACH_ORIGINAL_MESSAGE')" name="Body"/>
</log>
</sequence>
</foreach>
If you want to use this properties without prefixes you should check that foreach
attribute id
is absent. If it's present and empty you should use underscore prefix.
Upvotes: 3