cancel
Showing results for 
Search instead for 
Did you mean: 

counter in mapping for every succesfull message....

Former Member
0 Kudos

Counter to be maintained for every execution of map.Requirement is to generate sequence number which should be like counter.Whenever this map runs and file is created, sequnece numberhas to be generated and it should be appended accordingly when it runs for second time.Like on a particular day, if this interface runs once, counter should be populated as once and next time when it runs it should be incremented to 2

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

there is a option of add counter in File Construction Mode of Receiver file adapter. U can try to use that I m not sure whether it will work for ur specific requirement or not? but atleast u can give a try.

chirag

Former Member
0 Kudos

Thanx for u r answer,

I think i didnt phrase my question properly,

my requirement is like i need counter value in mapping so that i can map it to a field in taget structure.

Former Member
0 Kudos

wat I understood is

first time ur mapping is run the counter value is set to 1 and is mapped to target.

second time the same mapping is run counter shud be incremented by one and mapped to target field.

this is wat u r looking for.

if yes:

what u can do is u can maintain one table which shud hold the interface no and count no.

first time when mapping runs the table will be updated with count value one. when the mapping run second time the counter value will be incremented n it will update the data in that table.

u have to use the lookup.

chirag

Answers (2)

Answers (2)

former_member192295
Active Contributor
0 Kudos

Hi,

We can do through UDF, develop simple UDF function for counter and result will be stored in file along with date along with reference number. Each transaction function will search automatically if reference number is exit or not, if exit increment counter and pass to target structure else store the value in file and pass counter value.

Former Member
0 Kudos

hi

you can do this by using global container veriable in the UDF.

This object enables you to cache the values that you want to read again when you next call the same user-defined function or a different user defined function .

you can create container veriable by using

GlobalContainer globalContainer;

globalContainer = container.getGlobalContainer( );

and to set the value you can use these method

void setParameter (String parName, Object obj);

and to get the value again use

Object getParameter(String parName);

regards,

navneet