HttpGateway loop

Hi Mediators,

I have a problem invoking a SagHttpGateway inside a while loop.
My sequence performs a XQuery in Tamino and transforms the result by a SagTransformer component.
The XSL transformation make a list of Mediator sequences url, like:


These urls are invoked in a while component by HttpGateway.

Now if I have more than 1 sequence to call, it seems HttpGateway is invoked only once.

  • Have I got a synchronization problem?

May anyone help me?


Hi Raffaele,

Deterministic in this case is of course the sequence you defined and the document resulting from your transformation.

In general, what you want to do is possible but your while loop will have to utilize an iteration value obtained by counting the appropriate nodes in your document which contains the URLs.

If you believe the logic in your sequence to be 100% correct, then you should look at what is happenning with the HTTP Gateway call.

For instance: Is the current payload, and therefore your list of URLs to call, being replaced by the HTTP Gateway result?

If this is the case, then you will have to apply some of the Multi-part message support we provide in sequence processing and direct the result to a new content ID.

Hi Matthew,

I have just worked out the problem described above.
The first time I called the HttpGateway inside the while loop, I lost the payload and therefore the next mediator’s urls.

I have stored by a while loop the urls into mediator properties and after invoked them by another while loop.

Here is below my sequence

<?xml version="1.0" encoding="UTF-8"?>

Thanks so much


Hi Raffaele,

After I looked at your sequence… I have some concerns about the performance of your sequence.

Running through 2 loops is of course the main issue but I am also interested in what you are trying to do in the first place.

If I interpret the sequence correctly, you are trying to restart some messages in the persistence store. There are much easier methods to do this.

The most direct way would be to place a copy the query you are placing against Tamino into a loop and changing the accessor type to xml. This causes only one result set at a time to be returned.
When you have that result, you can use the message ID to call the restart statement to send the returned message object to the original sequence. The very basic logic would look like:

  1. Tamino Connection
  2. Tamino XQuery (XML Accessor)
  3. set messageID to the reurned message ID in the Xquery result document.
  4. restart using the messageID
  5. While statement - check for existence Tamino itteration property
  6. Tamino XQuery (XML Accessor) - using the same query as in the original.
  7. set messageID to the reurned message ID in the Xquery result document.
  8. restart using the messageID
    9 End While