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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileCopy logging questions

Hi everyone,

I am new to Talend and I'm struggeling with the setup of the following flow:

I am copying files and logging this action with (iterative) tFileList ---> tFileCopy ---> tFlowToIterate ---> tIterateToFlow ---> tFileOutputDelimited

 

I have 2 questions:

1. It feels unnatural to use tFlowToIterate ---> tIterateToFlow for defining values to log with tFileOutputDelimited. Is there a better way of doing this?

2. I have set contexts of the Directory-type (with no "", I use the browse button to pick the folder), but when I use these in the tFileList directory field and the tFileCopy directory field (context.dir1), I get error "dir1 cannot be resolved to a variable". What could be causing this?

Labels (2)
8 Replies
Anonymous
Not applicable
Author

Can you provide a screenshot of your job + the config of the file components?

What exactly are you trying to log?

 

Anonymous
Not applicable
Author

I want to log to a local file: which file was moved, at what time, from where, to where.

File components and context definitions + errors below. When I replace the context attributes with hard coded file paths "S:/etc." all files are moved correctly.

 

0683p000009Lr2T.pngflow

0683p000009Lqyi.pngcontexts

0683p000009Lqsc.pngtFileList_3

0683p000009LrAG.pngtFileCopy_3

0683p000009LrAi.pngtFileCopy_4

0683p000009LrAZ.pngErrors

Anonymous
Not applicable
Author

Try changing data type of your context variables from Directory to String.

Anonymous
Not applicable
Author

Changing to string (with "") results in the same error.

 

Could it be related to JDK version (JDK 1.7.0.790 with Java 8.0.910.15)?

Anonymous
Not applicable
Author

That is a possibility.  Can you open the 'code' tab of your job and find the compilation error? That may point you in the right direction.

Anonymous
Not applicable
Author

Hi,


@Auke wrote:

Changing to string (with "") results in the same error.

 

Could it be related to JDK version (JDK 1.7.0.790 with Java 8.0.910.15)?


Have you ever executed your job successfully in your current studio with JDK 1.7.0.790 with Java 8.0.910.15? On which talend build version you are using?

Best regards

Sabrina

Anonymous
Not applicable
Author

Error at the red context.CMPverd: CMPverd cannot be resolved or is not a field 

The other contexts generate identical errors.

 

There are also some warnings about multiple markers, about type safety and about the static method convertToJsonText.  Are those relevant for my issue?

 

				ok_Hash.put("tFileList_3", false);
				start_Hash.put("tFileList_3", System.currentTimeMillis());

				currentComponent = "tFileList_3";

				int tos_count_tFileList_3 = 0;

				class BytesLimit65535_tFileList_3 {
					public void limitLog4jByte() throws Exception {

					}
				}

				new BytesLimit65535_tFileList_3().limitLog4jByte();

				String directory_tFileList_3 = context.CMPverd;
				final java.util.List<String> maskList_tFileList_3 = new java.util.ArrayList<String>();
				final java.util.List<java.util.regex.Pattern> patternList_tFileList_3 = new java.util.ArrayList<java.util.regex.Pattern>();
				maskList_tFileList_3.add("WG.CIC_bedankv0_*.csv");
				maskList_tFileList_3.add("WG.CIC_TMBED0_*.csv");
				for (final String filemask_tFileList_3 : maskList_tFileList_3) {
					String filemask_compile_tFileList_3 = filemask_tFileList_3;

					filemask_compile_tFileList_3 = org.apache.oro.text.GlobCompiler
							.globToPerl5(
									filemask_tFileList_3.toCharArray(),
									org.apache.oro.text.GlobCompiler.DEFAULT_MASK);

					java.util.regex.Pattern fileNamePattern_tFileList_3 = java.util.regex.Pattern
							.compile(filemask_compile_tFileList_3);
					patternList_tFileList_3.add(fileNamePattern_tFileList_3);
				}
				int NB_FILEtFileList_3 = 0;

				final boolean case_sensitive_tFileList_3 = true;
				final java.util.List<java.io.File> list_tFileList_3 = new java.util.ArrayList<java.io.File>();
				final java.util.Set<String> filePath_tFileList_3 = new java.util.HashSet<String>();
				java.io.File file_tFileList_3 = new java.io.File(
						directory_tFileList_3);

				file_tFileList_3.listFiles(new java.io.FilenameFilter() {

 

 

Anonymous
Not applicable
Author

Hi Sabrina, when I replace te contexts with hard coded directory paths, the job runs fine.

With contexts containing the directories however, it always fails.

I'm on TOS version 6.4.1.20170623_1246