Problem with context prompt params

One Star

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 Smiley Sad
Ex:
Talend Open Studio

hope you guys can help me Smiley Very Happy
Seventeen Stars

Re: Problem with context prompt params

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
One Star

Re: Problem with context prompt params

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
Seventeen Stars

Re: Problem with context prompt params

you have to pass it in your script with --context_param.
One Star

Re: Problem with context prompt params

could you give me an example?
i'm learning how to use talend open :/
Seventeen Stars

Re: Problem with context prompt params

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
One Star

Re: Problem with context prompt params

kzone, i'll try to do that, but thanks anyway for helping Smiley Very Happy
Five Stars

Re: Problem with context prompt params

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.