Search code examples
xmlwso2wso2-data-services-serverwso2-integration-studiowso2-esb

WSO2 ESB enrich mediator inside an iterator mediator


I make a call to a DSS service and receive XML back I then use the iterator mediator to iterate over the tag in the XML. Inside the iterator I use an enrich mediator to add some XML nodes to the XML but each time it loops or leaves the iterator the changes are gone, even on the last loop the returned XML does not keep any of the changes.


Solution

  • Iterate mediator acts like clone mediator. The difference is that it splits the initial message into several fragments (it does not duplicate the initial message)

    If you choose to continue the parent mediation after iterate mediator (attribute continueParent set to true), you see the initial message (the one you were mediating before iterate occurs)

    If you want to change the content of the initial message, you must use enrich / XSLT / javascript outside iterate or clone