Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi gays,
i work for project automation migration data from database to another .
i create 3 job
job 1 for migration data from Sql server to oracle
job 2 for migration data from oracle to oracle
i want to create a job parent for test ;
if CMD line content the context param of job 1 then run job 1
else run job 2
thinks for your response
i can parse parameter database with tjava to child job ??
The tContextLoad needs to be used as shown in the example here ...(https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/xH2TyYr_AmQnKwOYlqVCvA).
If you are passing the value to your job using the CMD line, you do not need to worry about the tContextLoad. Simply use a tJava where your tContextLoad component is and link the RunIfs from there.
thinks for your response
i can parse parameter database with tjava to child job ??
The tJava is used simply as a dummy start component. You are really just relying on the RunIf links.
hello,
i create the job with component tjava
java Code in tjava:
String contextsqlserver_Database;
if (contextsqlserver_Database != null){
globalMap.put("isNull", true);
}
else {
globalMap.put("isNull", false);
}
i want to test if contextsqlserver_database is parsed in cmd line with value , the job executed is job 1
the condition in run if 1
(Boolean)globalMap.get("isNull")==true
else
run job 2
the issus : contextsqlserver_database may not have been initialized
have you another solution
thanks
How are you passing the context variable in the command-line? This seems to be the problem.
What is your requirement for passing the context variable, how are you starting the job and can you use other functionality to do this?
hi,
because i work for automation project and i want create a pipeline for migration data from
sqlserver-------> oracle
oracle ------> oracle
and i want to insert the command line in scriptshell
I understand that, but you said that you were not sure the context variable value was being passed correctly. How are you passing the context variable in the command-line?
i build a job and run this commande :
databaseTransfer_run --context_param contextsqlserver_Port=............. --context_param contextsqlserver_Database= ..... --context_param contextsqlserver_Schema=..... --context_param contextsqlserver_Password=....... --context_param contextsqlserver_Login=........ --context_param contextsqlserverr_Server=........ --context_param OracleConnection_Port=........ --context_param OracleConnection_Sid= ........... --context_param OracleConnection_Password= ........ --context_param OracleConnection_Login=............. --context_param OracleConnection_Server=.............--context_param OracleConnection_Schema= .................
OK, that looks like it should be working. The next thing to test is that the values are getting through. To do this, add some code to your tJava to print out the values of your context variables. For example,....
System.out.println("Context named Test ="+context.Test);
This will show whether the values are reaching your job.