cancel
Showing results for 
Search instead for 
Did you mean: 

The sequence number of message

Former Member
0 Kudos

Hello Experts,

On the target message we have a field where the message sequence number have to be saved.

So the question is how we can do that?

Is there is some global storage to save the counter?

I guess JAVA-sections and GlobalContainer will not work here as I need some storage which we be global to all instances of the mapping.

Thanks for your responses.

Best Regards,

Artsiom Anichenka

Accepted Solutions (1)

Accepted Solutions (1)

GabrielSagaya
Active Contributor
0 Kudos

You can follow these steps to generate a sequence no using global container.

1) Define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.

2) Enter the following in the GlobalVariables Section

Integer counter =0;

3) Define a user defined function

function myudf(Container container)

{

Integer seq = 0;

GlobalContainer globalContainer = container.getGlobalContainer();

a = globalContainer.getParameter("counter");

seq = globalContainer.getParameter("counter");

seq = seq + 1;

globalContainer.setParameter("counter",seq);

return a;

}

4) use myudf to your target field

myudf--->target sequence no field

Answers (0)