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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with context prompt params

Hello guys,
I'm in trouble with prompt box for context params 😕
when i run it on the IDE Talend Open it works fine, but when i build the job and run into a .bat file, it doesn't appear 0683p000009MPcz.png
Ex:
Talend Open Studio

hope you guys can help me  0683p000009MACJ.png
Labels (2)
7 Replies
Anonymous
Not applicable
Author

hi,
it's a normal behavior. Prompt context is only works in studio.(dev context)
It's not design to affect values in exploitation environment with a prompt UI.
regards
laurent
Anonymous
Not applicable
Author

hi,
it's a normal behavior. Prompt context is only works in studio.(dev context)
It's not design to affect values in exploitation environment with a prompt UI.
regards
laurent

thanks for replying, but there's a solution to do it?
i mean, i need to run a .bat and show the prompt box, with 2 dates: init date, end date
and those dates are params for tFilterRow on context params.
maybe there's an other solution
Anonymous
Not applicable
Author

you have to pass it in your script with --context_param.
Anonymous
Not applicable
Author

could you give me an example?
i'm learning how to use talend open 😕
Anonymous
Not applicable
Author

When you've built job, open the .bat or .sh file (a java command line)
could be something like :

#!/bin/sh
cd `dirname $0`
 ROOT_PATH=`pwd`
 java -Xms256M -Xmx1024M -cp $ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH/../lib/talend_file_enhanced_20070724.jar:$ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar:$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/poc1_0_1.jar: test.poc1_0_1.POC1 --context=Default "$@"

As you can see, there's already a call to a context environement --context. it's related to your different context env that you have declared in your job.
afterward, you can overwrite any params with --context_param yourParam=value


#!/bin/sh
cd `dirname $0`
 ROOT_PATH=`pwd`
 java -Xms256M -Xmx1024M -cp $ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH/../lib/talend_file_enhanced_20070724.jar:$ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar:$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/poc1_0_1.jar: test.poc1_0_1.POC1 --context=Default  --context_param yourParam=value "$@"
 

it's a script, so you also pass the value as argument of this script and make value a variable.

#!/bin/sh
cd `dirname $0`
 ROOT_PATH=`pwd`
 java -Xms256M -Xmx1024M -cp $ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH/../lib/talend_file_enhanced_20070724.jar:$ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar:$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/poc1_0_1.jar: test.poc1_0_1.POC1 --context=Default  --context_param yourParam=$1 "$@"

And you call your job with value as arg.

./POC1_run.sh yourvalue

I prefer to use explicit/implicit context load in general with a config.ini
https://help.talend.com/search/all?query=Context+settings&content-lang=en
hope it helps
regards
laurent
Anonymous
Not applicable
Author

kzone, i'll try to do that, but thanks anyway for helping 0683p000009MACJ.png
Anonymous
Not applicable
Author

Why does Talend only allow you to prompt for context variables, in the Design Tool? There seems little point in this.
I can see many application where it would be useful to have a dialog of options appear, when you run your Job (as a standalone Job).
Some have suggested that you can use tMsgBox; but this doesn't really cut it, especially if you want to use a directory/file chooser.