‘Continue’ in XML xlates…

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf ‘Continue’ in XML xlates…

  • Creator
    Topic
  • #48959
    David Gordon
    Participant

      Noticed some odd behaviour in 5.4 rev 1.  If you have an XML message that has the following basic structure:

      {

      HEADER

      [{LINE ITEM}]

      }

      So a repeating set of header records with one or more line items.  If you want to break this into individual messages, you should be able to just iterate over the headers with CONTINUE/SUPPRESS like normal, right?

      However, with XML, it seems that the CONTINUE command does not actually send a message, nor does SEND.  It just appends on to one message, so if you have a scenario where your data looks like this:

      HEADER1

      LINE1

      LINE2

      LINE3

      HEADER2

      LINE1

      Instead of getting the following two messages:

      HEADER1

      LINE1

      LINE2

      LINE3

      HEADER2

      LINE1

      You get:

      HEADER1

      LINE1

      LINE2

      LINE3

      HEADER2

      LINE1

      LINE2

      LINE3

      Not only do you not get two messages, the second header has the leftover records from the first…  

      Looks like a bug, but I can’t think of another simple way to split these XML files into individual messages.

      Has anyone had any experience with this?

    Viewing 2 reply threads
    • Author
      Replies
      • #60237
        Nathan Martin
        Participant

          1. The previous message data/segments always show up in the next message unless you @null them out or delete them somehow.  (I suppose with the right proc you could save a copy of the default message, then restore it after every send, but i haven’t done that.)

          2. Seems like SEND should really be sending new messages.  Are you sure those messages aren’t just being appended in the output file or something like that?

        • #60238
          David Gordon
          Participant

            1.  Generally if use suppress that doesn’t seem to be an issue, or at least I’ve never noticed it.

            2.  Positive, it just appends new XML records into the current message.  I guess ‘CONTINUE/SEND’ inside a translate with an XML destination is borked.   Damn.

          • #60239
            Nathan Martin
            Participant

              I looked through the archives.

              Here is an example of somebody clearing out the whole message (which was overkill because it was clearing out the common message details) but you get the picture.

              https://usspvlclovertch2.infor.com/viewtopic.php?t=1436&highlight=suppress” class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1436&highlight=suppress

              It’s likely your previous Xlates just copied over the per-message data every time.  I think that assuming the per-message segments and fields will be automatically reset is a common, possibly dangerous, mis-understanding about SEND/SUPPRESS.  Initially I also thought it would reset by itself…  It looks declarative and magical, but xlate actions perform in a procedural way.  How would it know which parts of the global output message you’d want to reset?  There are no BOOKMARK, FREEZE, RESET, or equivalent actions provided.

              Also, here is a post that suggests the testing tool may sometimes display multiple messages as one message.

              https://usspvlclovertch2.infor.com/viewtopic.php?t=391&highlight=suppress” class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=391&highlight=suppress

              Good luck,

              Nathan

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.