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 Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


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.