3 Replies Latest reply: Apr 20, 2012 1:11 AM by AigarsP RSS

    OSB insert action

    AigarsP
      Hi,
      I have use case where I need to fill and insert some element before routing to business service.
      Tricky part is that I need to insert element between optional elements, so I think neither of insert after/before/first/last will work.

      lets say, incoming element is like this
      <root>
      <A>1</A>
      <B>2</B>
      <C>3</C>
      
      <D>4</D>
      <E>5</E>
      <F>5</F>
      </root>
      where A to F are minoccurs="0" elements.

      Now how can I insert, lets say <X>999</X> between C and D?
      If I would use "after C" and C is missing, then X is not inserted. If I use first or last and any of A-F elements exist, then there is schema validation error at business service. I think of something like finding last existing element of A/B/C. Or something else?

      Thank you for help