Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How can I execute components like tFileCopy and tFileDelete from within a tJava/tJavaFlex component. The idea is I would like to rename/move an input file based on certain conditions. My current sample code looks like below and it is obviously wrong because I don't know the sytnax for calling components from within tJava/tJavaFlex components.
I guess an alternative would be to use the tSystem compont within tJava, but I would run into the syntax problems as well. I am not particular whether I used tSystem or tFileCopy - I just want something that does the job.
**The code in the end code section of a tJavaFlex component:
if (num_rows > 0) {
tFileCopy( ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) ,
context.error_dir + jobName + "/" ((String)globalMap.get("tFileList_1_CURRENT_FILE"))
);
}
With the above code I get the error:
Hello,
With your requirement, you can use "RunIf" trigger which triggers a subjob or component in case the condition defined is met.
You can add your code in the Condition section. Such as: Main job-->RunIf(num_rows > 0)-->tFileCopy.
Best regards
Sabrina