Search code examples
talend

[Talend]How to define a global filed in a talend job


i create a talend job named aaa. talend will auto create code like:

public class aaa { 
     ...
     ...
     // TODO i want define a field
     private String name = "test";
}

how can i implement to define field name? ps: i don't want to use context or globalMap.


Solution

  • Define a Routine, call it VALUES. In the VALUES routine, define your values in public static field.

    package routines;
    
    public class VALUES {
       public static String fubar="Hello World";
    }
    

    then in others components, you make a reference to the fubar field with VALUES.fubar