• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] tDie after RunIf condition

#1 2012-05-14 15:04:51

olivierjurine
Member
Registered: 2011-07-11
Posts: 18

[resolved] tDie after RunIf condition

Hi,

I'm using TOS 5.0.1 with AS400 SGBD.

I would like to create a parent job to transmit by integer variable (context) asked "STOP_TO_ERROR" an argument to child job.

My child job execute an tAS400Row and testing the variable "STOP_TO_ERROR" and if equals 1 then execute tDie component to stop process:

tAS400Row --> RunIf --> tDie

If condition : ((Integer)globalMap.get("STOP_SI_ERREUR")).equals(1)

When I'm executing the parent job I have an error message :

[statistics] connecting to socket on port 3569
[statistics] connected
Exception in component tAS400Row_1
java.lang.NullPointerException
    at shlmr.alim_maj_statut_0_1.alim_maj_statut.tAS400Row_1Process(alim_maj_statut.java:895)
    at shlmr.alim_maj_statut_0_1.alim_maj_statut.runJobInTOS(alim_maj_statut.java:3625)
    at shlmr.alim_maj_statut_0_1.alim_maj_statut.runJob(alim_maj_statut.java:3312)
    at shlmr.aaa_0_1.aaa.tRunJob_3Process(aaa.java:1246)
    at shlmr.aaa_0_1.aaa.tAS400Input_1Process(aaa.java:1116)
    at shlmr.aaa_0_1.aaa.runJobInTOS(aaa.java:3997)
    at shlmr.aaa_0_1.aaa.main(aaa.java:3646)
Exception in component tRunJob_3
java.lang.RuntimeException: Child job running failed
    at shlmr.aaa_0_1.aaa.tRunJob_3Process(aaa.java:1264)
    at shlmr.aaa_0_1.aaa.tAS400Input_1Process(aaa.java:1116)
    at shlmr.aaa_0_1.aaa.runJobInTOS(aaa.java:3997)
    at shlmr.aaa_0_1.aaa.main(aaa.java:3646)
[statistics] disconnected

I think i should be used tJava or tJavaRow component...

How to create RunIf condition to testing my parameter after execute the tAS400Row ?

See a screenshot.

Regards,
Olivier


Uploaded Images

Offline

#2 2012-05-15 05:05:20

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] tDie after RunIf condition

Hi Olivier

According to your description, now the problem is how to pass the value of "STOP_TO_ERROR" from main job to child job, for which you need to configure 'Context param' on tRunjob.

Here is a previous topic [Forum, topic 21855] [resolved] Golbal variables ussage.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-05-15 06:17:34

olivierjurine
Member
Registered: 2011-07-11
Posts: 18

Re: [resolved] tDie after RunIf condition

Hi Pedro,

It's ok for this part.

My problem is to testing my variable after executing tAS00Row (from my screenshot).

If I using Run If condition after tAS400Row I have this error
. I don't know if it's an obligation to use tJava component for loading «STOP_TO_ERROR» before testing this parameter on If condition.

In another job, I'm using this condition after tJavaRow :

tAS400Input --main--> tJavaRow --If-->tRunJob
And it's ok, I can replicate the result of tAS400Input on my variable by the tJavaRow and testing my variable on If condition...

But, how to create this job :

tAS400Row --?--> tDie.
tDie not depending of tAs400Row, is executing after this.
tDie depending of my ParentParameter «STOP_TO_ERROR».

Thanks

Offline

#4 2012-05-15 07:26:21

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] tDie after RunIf condition

Hi

Please show me the screenshot about tRunjob in your main job.

The reason you got NPE exception is that global value "STOP_TO_ERROR" wasn't passed from main job to child job.

Solution:  Add a context variable called new1 in the child job.
                Configure tRunJob component of the main job as the following image.
                Modify the expression of Run-if trigger in the child job with context.new1.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

#5 2012-05-15 07:56:36

olivierjurine
Member
Registered: 2011-07-11
Posts: 18

Re: [resolved] tDie after RunIf condition

See my screenshot from parentjob and childrenjob.

To resum, I'll would like to stop process (all jobs) when asking childjob and "STOP_TO_ERROR" parameters = 1.

Parent Job in order process :
ParentSearch.jpg
JavaRowParent.jpg
If2Parent.jpg
ParentJob.jpg
If1Parent.jpg
ParentJobOK.jpg


Children Job in order :
contextchildjob.jpg
ChildJobUpdate.jpg
IfChildJob.jpg


Uploaded Images

Last edited by olivierjurine (2012-05-15 08:02:55)

Offline

#6 2012-05-15 08:10:39

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] tDie after RunIf condition

Hi

Here is the expression of Run-if trigger in this child job.

Code:

context.STOP_SI_ERREUR==1

I think you don't understand how to pass value with tRunjob.

Regards,
Pedro


Only Paranoid Survive.

Offline

#7 2012-05-15 08:17:02

olivierjurine
Member
Registered: 2011-07-11
Posts: 18

Re: [resolved] tDie after RunIf condition

Ok...

Many thanks for your reply wink


Regards,
Olivier

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] tDie after RunIf condition

Board footer

Powered by FluxBB