#1 2008-07-09 12:36:11

spyke
Guest

Numeric sequence reset

Hello,

i am using a variable inside a tMap like this ---> Numeric.sequence("s1",1,1) * 10

so for each record processed i get 10, 20 ,30 and so on

the problem is that i need to reset this sequence each time i launch the job...

when launching the job from inside talend, the sequence is correctly resetted but if i export my job as
webservice, the sequence never resets.

is it possible to resolve this problem? Thanks in advance.

#2 2008-07-10 10:35:46

spyke
Guest

Re: Numeric sequence reset

can anyone help?

#3 2008-07-11 11:58:27

spyke
Guest

Re: Numeric sequence reset

up

#4 2008-07-11 13:39:55

amaumont
Talend team
Registered: 2006-09-20
Posts: 471

Re: Numeric sequence reset

I suggest you to add a feature to improve it.

Yet, you can duplicate Numeric routine and add a method such as:

Code:

    public static void resetSequence(String seqName, int startValue) {
        seq_Hash.put(seqName, startValue);
    }

Offline

#5 2008-07-11 16:48:55

spyke
Guest

Re: Numeric sequence reset

thanks a lot, it worked!

i created a new Routine, i copied Numeric routine code and i added this method:

public static void resetSequence(String seqName){
           seq_Hash.put(seqName, 0);
    }

Then i call the method from a tava component. Thanks again for your answer

#6 2008-07-11 17:00:41

amaumont
Talend team
Registered: 2006-09-20
Posts: 471

Re: Numeric sequence reset

Please create a feature to improve the product even this method works, it will improve the product for the next release, thank you.

Offline

#7 2010-06-03 13:28:36

Myziot
New member
Registered: 2009-12-18
Posts: 9

Re: Numeric sequence reset

When I try to install this routine, the "seq_Hash.put(seqName, 0);" part get's red-underlined. seq_Hash in particullar.. Any ideas why my TIS 3.2 doesn't have that Java class? Is there any particullar class I need to import on the top of the routine package??

Help would be much appreciated.

Offline

#8 2011-03-11 17:44:33

Alexander
Guest

Re: Numeric sequence reset

You should copy sequence related code from Numeric system routine, add new method and use your routine instead of system.

Board footer

Powered by FluxBB