Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Passing a context file from command line

Hello everyone,

 

I found a lot of threads about this problem but none helps me.

 

I try to execute a job from the command line by passing the following command (I need to execute job with two different contexts):

myJob.bat --context=myContext

 

The problem is such as myContext needs to be in a specific folder of the job folder. However, I need my context in an other place. So I should pass the path of the context file in the context parameter like:

myJob.bat --context=path/myContext

But it seems to not work, I got an error message 'Could not find the context myContext'.

I tried with simple cotes and doubles cotes but it didn't change anything.

 

How to pass this kind of parameter, a context file with a specific path?

Or, how to change the default folder where the context files need to be there?

 

Here is the tree view to help understanding the need:

  • jobFolder
    • myJob (the .bat file)
    • project (folder generated by Talend when building the job)
      • job
        • contexts
          • Context files that I can pass (so I should copy my context files there but I need them in an other folder)
  • customizedContexts
    • myContext (the context file that I want to pass, but I don't know how to pass the path to this file)

 

Thank you for your help,

 

Kevin

Labels (2)
3 Replies
Anonymous
Not applicable
Author

I believe passing passing --context=myContext might only pass the name of the context env ex. Dev, Prod, ... but cannot externalize the location of a context file.

try using a tFileInputDelimited-> tContextLoad to externalize the context file. See the doc of tContextLoad
Anonymous
Not applicable
Author

I created two tFileInputDelimited-> tContextLoad units in my job, that correspond to my two contexts.

 

How to pass the context that I want to use when I execute the job from the command line? I seen something like --context_parameter but it didn't works for me.

 

Or do I need to have only one tFileInputDelimited-> tContextLoad unit, and a .properties file that contains my two environments? In this case, how to choose which one environment I want to use when I pass the context form the command line?

 

Thanks,

Kevin

Anonymous
Not applicable
Author

Here is the command line help. You can pass the context name using --job-context

 

executeJob jobName executes |
| -i (--interpreter) path perl/java interpreter path |
| -jactc (--job-apply-context-to-children) apply context to children |
| -jc (--job-context) context name chooses a job context |
| -jcp (--job-context-param) key=value [key=value ...] provides a job context param |
| -jrdd (--job-result-destination-dir) path job execution result |
| destination dir |
| -jt (--job-timeout) time (in sec) timeout of execution |
| -jv (--job-version) version chooses a job version |

 


| executeJobOnServer jobName executes on server |
| -es (--execution-server) name execution [virtual] server |
| name |
| -jactc (--job-apply-context-to-children) apply context to children |
| -jall (--job-log4j-level) level log4j level |
| -jc (--job-context) context name chooses a job context |
| -jcp (--job-context-param) key=value [key=value ...] provides a job context param |
| -jrrd (--job-result-destination-dir) jobResultDestDir job execution result |
| destination dir |
| -jsp (--job-statistics-port) port setup the statistics port |
| -jtp (--job-trace-port) port setup the trace port |
| -jv (--job-version) version chooses a job version |
| -pd (--jobserver-password) password jobserver password |
| -ra (--run-as-user) runas run as user |
| -un (--jobserver-username) username jobserver username |
| -useSSL (--use-ssl-option) use ssl Protocol or not