Generating a Sequence Number in IS

Is anyone familiar with creating a sequence number in WM 6? We are trying to avoiding having to use something like a Java hash table in which we would have to go outside of the application. If there is an in-built service or method that can be used for this, please let me know…


If you have the EDI Module: Core Component you can use wm.b2b.edi.util:ctlNumber as a sequence number generator. From the docs: “Creates a nine-digit number, based on a two-digit day, two-digit hours, two-digit minutes, and a random three-digit system count (100-999).”

If this isn’t sufficient, or you don’t have the EDI Module, writing a simple Java service to do this would be fairly trivial

If the sequence numbers just have to be in the correct order and not necessarily sequential, you could you a currentDate call with the pattern ‘yyyyMMddHHmmssSSS’ to get a sequence number down to the milliseconds. It’s best to hard code a time zone into the call if you do this so that sequences have no chance of overlapping at daylight saving time change over.