{"methods":[[{"p_id":"v1","offline":false,}],[{"p_id":"v2","offline":true,}]]}
The above is my JSON payload. I am making use of nested Iterate mediators to fetch the values of p_id and v1. I am able to fetch the values successfully, but the logs outside the first iterate mediator are not getting printed.
Following is my code:
<iterate expression="json-eval($.methods)" id="iterate-over-Methods">
<target>
<sequence>
<iterate expression="json-eval($)" id="2nd-iteration">
<target>
<sequence>
<filter regex="false" source="json-eval($.offline)">
<then>
<property expression="json-eval($.p_id)" name="p-id" scope="default" type="STRING"/>
<log>
<property expression="$ctx:p-id" name="p-id-set"/>
</log>
</then>
<else>
<log>
<property name="p-id-set" value="Provider ID already set"/>
</log>
</else>
</filter>
<log>
<property name="status-1" value="Inside 1st iteration" />
</log>
</sequence>
</target>
</iterate>
<log>
<property name="status-2" value="Inside 2nd iteration" />
</log>
</sequence>
</target>
</iterate>
Is the code going into some infinite loop that it is not coming out? How can I handle this? Thanks in advance..