Numeric.sequence per Job

One Star

Numeric.sequence per Job

my JobA calls JobB via a tRunJob.
Within JobB, I've got a tJava where I call Numeric.sequence.
Unfortunately Numeric.sequence starts only the first time I call JobB with 1. But I want it to start from 1 everytime I call JobB.
From JobA I call tRunJob (JobB) via a OnComponentOK (because it's a tJava which calls tRunJob) - is this ok?
Within JobB I use:
id = Numeric.sequence ("s1", 1, 1);

(but it's in a routine and get's called from the tJava)
Is it somehow possible to reset id after JobB finished?
I found this: but I have a subJob, do I have to do it like this, too?
Thank you in advanced.
Bye, Chris
One Star

Re: Numeric.sequence per Job

You can use the process id in the sequence name :
id = Numeric.sequence(pid, 1, 1);

It's explained here :
Best regards,
One Star

Re: Numeric.sequence per Job

Hi Karine,
thank you for your reply.
Got it working now Smiley Happy

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.



Introduction to Talend Open Studio for Data Integration.


Downloads and Trials

Test drive Talend's enterprise products.