Four Stars

tContextLoad fails with Integer as null

Hello,

as the Talend Studio performance decreases drastically with a lot of objects in one job, we are trying to outsource some logic to Subjobs.

Unfortunately there is an error while promoting the context variables back to the main job.

  • We promote all context variables to the subjob
  • We do stuff in the subjob
  • We want to promote the context variables back to the main job
    • Job fails if there is a Integer not assigned (null)
    • tContextLoad uses key/value mechanism using strings, which fails if "null" is assigned to an Integer

MainJobMainJobMainJob ContextMainJob ContextSubjobSubjobMainJob RunMainJob Run

Help would be appreciated.

1 REPLY
Employee

Re: tContextLoad fails with Integer as null

Maybe you can use a value like -1 or 0 for that context variable which will mean to not use it.  You can add a tMap or tFilterRow before your tContextLoad and filter on the value null key/pair.  If you do not pass a value, then it is not overwritten.  However, the tContextLoad can be configured to ignore, warn or error on these conditions.  This way you do not need to deal with null integer values. 

 

Not a great solution, but I personally dislike null Integer values... If possible, which is not always the case, I try to give my numeric variable a value and do not allow nulls.