Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get parameter values from talend UI to service.java

Hi all,

I  am trying to create custom component for one CRM.I need get values which are passing in talend for service.java . when I am using getter methods of datastore ,its getting null pointer exception.please me help me out. Any possibility is there get  like..

 String serverAddr = ElementParameterParser.getValue(node, "__SERVERADDR__");

 

thank you,

venkat.

Labels (2)
1 Reply
Os1
Contributor
Contributor

Hi Venkat_C,

 

are you using javajet or Component kit?  if your using kit then either pass the configuration object directly to the method that needs it in service or  create a constructor in the service like this 

 

@Service public class myService{ private MyService myservice; public MyService(MyService myservice){ this.myservice=myservice; } }

 The create an instance of the service class like this , in either the source class for an input component, or processor for a processing component.

 

 

    public CompanyComponent1Processor(@Option("configuration") final CompanyComponent1ProcessorConfiguration configuration,final CompanyComponentService service) {
        this.configuration = configuration;this.service = new  service(this.configuration);
    }

 

 

 

best regards 

Os