Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

reading inputs from user when running talend job as executable jar

Highlighted
Six Stars

reading inputs from user when running talend job as executable jar

I want to read inputs like username and password from user when we run talend job externally using .bat file...please suggest me to achieve this

Highlighted
Employee

Re: reading inputs from user when running talend job as executable jar

Hi,

 

    You need to use context variables which will be populated at run time.

 

https://community.talend.com/t5/Design-and-Development/How-to-use-context-variable-at-run-time/td-p/...

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Highlighted
Six Stars

Re: reading inputs from user when running talend job as executable jar

If possible could you please share some screen shots ...

Highlighted
Employee

Re: reading inputs from user when running talend job as executable jar

Hi,

 

    I could see that its clearly mentioned in below post.

 

https://community.talend.com/t5/Design-and-Development/resolved-Passing-variable-context-value-from-...

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Highlighted
Six Stars

Re: reading inputs from user when running talend job as executable jar

I am trying to read few values from file but getting below error

 

 

Exception in component tSalesforceInput_1 (Test)
java.lang.RuntimeException: IOException: [LoginFault [ApiFault exceptionCode='INVALID_LOGIN'
exceptionMessage='Invalid username, password, security token; or user locked out.'
extendedErrorDetails='{[0]}'
]
]

tal3.PNGtal5.PNGtal4.PNG

Highlighted
Community Manager

Re: reading inputs from user when running talend job as executable jar

Hi @Lavankumar,

 

You need to create context variables first. For example, I have created some like this....

Screenshot 2019-03-07 at 18.18.05.png

 

These will then be used to populate your parameters for your component. To do this, given the examples above, they would be referenced in your component like so...

 

context.Username

...and ...

context.Password

Then in your file, they need to be represented like below....

Username;richard
Password;mypassword

Notice how the context variable names in the file are Username and Password and that they are referenced with "context." preceeding them.

 

Your Implicit Context Load settings should look like below (my file is called contexts.txt)...

Screenshot 2019-03-07 at 18.18.24.png

 

Highlighted
Six Stars

Re: reading inputs from user when running talend job as executable jar

For one of the variable i am not able to use context value

 

context3.PNG

context.PNG

contex2.PNG

Highlighted
Moderator

Re: reading inputs from user when running talend job as executable jar

@Lavankumar ,you can directly specify like context.Module_Name there in the custom object and id you are writing SOQL there in the commponet then the module name should be context.Module_Name.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog