Skip to Content
avatar image
Former Member

Creating a global variable for a counter.

All,

we have the following scenario - we are getting a flat file into XI. The file is converted into an xml message (<source> message) in content conversion with the records/message setting as 1000. So, the input file is split into messages with 1000 records/each. (except for the last one).

Now - we map these messages into another message (<sourceIdx> message) to add a counter node to the record structure (rest of the structure is the exact same). The question is we need to maintain the counter across the messages.

Meaning - if there are 100 <source> messages that are mapped to 100 <sourceIdx> messages. The first record in the first message will have the counter as 1 and the last one as 1000. we want the first record in the second message to start at 1001 and not 1 again.

How can we do this? Also - is there a way - where you can add this counter during the content conversion itself. That will save us this mapping.

Thanks,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 07, 2007 at 04:25 PM

    It might be possible to use a java pointer and point it at a reserved memory location in the XI box, then just modify and call this pointer in a UDF. Another possibility is to write a file with your number directly from the UDF to a place on the XI box and just call and modify this file with the UDF. I don't know if the second would actually work, but those are the non-XI involved way of doing it.

    Another option would be to explore using a BPM that would have your variable in it.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      We were thinking along the same lines on the BPM route. But how do you use the variable to populate the a particular node value?

      In the BPM we will be using a interface mapping - from <source> to <sourceIdx> - how can we pass the BPM variable as a parameter to the interface mapping??

      Thanks