cancel
Showing results for 
Search instead for 
Did you mean: 

[FileAdapter] Reset Counter

Former Member
0 Kudos

Hey,

I would like to reset the counter in my file adapter. Unlikely I just found [this thread|]

in this forum. But is there no other way to reset the counter as to restart

the engine? That's a poor way, isn't it?

Thanks in advanced.

chris

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

Just try to change the format of Add Counter and save and re-activate.

This will reset the counter

Thanks

swarup

Former Member
0 Kudos

Hey,

of course this works, but if I have to use a given naming convention,

I cannot change the names as I like to.

Is there no way to keep a name and reset the counter?

greetz

chris

Former Member
0 Kudos

You could do with UDF with following logic:

Get a Parameter from a global container, if NULL returned,

then you know this is very beginning of the function.

then you setParameter to 1, put it in your "FileName" of dynamic configuration.

Update your Parameter by set Counter = Counter + 1

If you get a number, check to see if the number is less than your pre-defined number (saying 100, you want to counter reach 100, then start from 1 again), if condition is true: then you put it in your FileName of dynamic configuration.

Update your Parameter by set Counter = Counter + 1

if condition is false, it indicates that you need to reset your counter from 1,

Update your Parameter by set Counter = 1.

For UDF mapping to Message Type level, do not return any thing.

Liang