Search code examples
talend

Skip a component based on condition in Talend


I have a scenario where I would like to skip a component to execute based on the condition and run its consecutive components in Talend.

Is it at all possible?


Solution

  • I've mocked up a job for you:

    I have a context variable called: startFrom It can be accessed with context.startFrom

    I've placed a tJava with a few tWarns: full overview of the job

    I use 4 context settings:

    1. Default
    2. Normal
    3. Opt
    4. two

    So my Job:

    1. Does nothing
    2. Start from "Start"
    3. Start from "Optional_Start"
    4. Start from "RecoverFromHere"

    If settings are the following:

    context.startFrom.equals("opt")

    Recovery and Recovery1 prints out their names using System.out

    If I start my job I can select where I want to start it. If I don't select anything: context value is null, it won't do anything.

    opt normal two