Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dazbellboy
Contributor III

[resolved] Execution of .jar with specific parameters

Hi everyone.
I have a job made in Talend. The job has a tFileList and it iterates on a tFileInputPositional. The tFileInputPositional has the value of ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

0683p000009MGSR.png

And the tFileList has the filemask of "*.FIL"

0683p000009MGSW.png

I need to execute the .jar generated after the build job by the .sh... but I need to send the filemask value of the tFileList in that .sh. The .sh content is this:

0683p000009MGSb.png

But I need add some value like "-fileName=some.FIL" to replace the file mask of the tFileList.
Can I modify the job before build it in order to configure the filemask of the tFileList to be passed as a parameter?

Thanks for your help.

Labels (2)
1 Solution

Accepted Solutions
cterenzi
Specialist

You want a context variable.  Within your Talend job, click on the Contexts tab and add a variable named fileName.  Set the filemask in your tFileList to context.fileName.

Edit your .sh file to add --context_param fileName="some.fil" 

You may not need to edit the .sh file, actually.  I think it would be ok to add the --context_param when you call the .sh

View solution in original post

2 Replies
cterenzi
Specialist

You want a context variable.  Within your Talend job, click on the Contexts tab and add a variable named fileName.  Set the filemask in your tFileList to context.fileName.

Edit your .sh file to add --context_param fileName="some.fil" 

You may not need to edit the .sh file, actually.  I think it would be ok to add the --context_param when you call the .sh
Dazbellboy
Contributor III
Author

cterenzi wrote:
You want a context variable.  Within your Talend job, click on the Contexts tab and add a variable named fileName.  Set the filemask in your tFileList to context.fileName.

Edit your .sh file to add --context_param fileName="some.fil" 

You may not need to edit the .sh file, actually.  I think it would be ok to add the --context_param when you call the .sh

Thank you very much for your help. It works.