[resolved] syntax error on token "(" exp expected: if statment seems to be wrong

One Star

[resolved] syntax error on token "(" exp expected: if statment seems to be wrong

Dear Team,
We have created an ETL with Talend (Version 5.0). We import some data with the ETL from flat file to Oracle database (11g). 
The generated java code seems to be wrong.
The error message as follows: syntax error on token "(", expression expected
Talend marks an "if" statement as erronous (please find the statement at the final part of the code):
I am not a java expert but it seems that this if close does not contains any condition:
   if () {
       
       tOracleRow_1Process(globalMap);
      }

Do you have any idea how to get read of the error or solve the problem. Shell we build the whole ETL again.
Any help/suggestion is appreciated.
Thank you for your support!
Best Regards,
Robert
Please find the method below:
Method:
public void tFileList_1Process(final java.util.Map<String, Object> globalMap) throws TalendException {
 globalMap.put("tFileList_1_SUBPROCESS_STATE", 0);
 final boolean execStat = this.execStat;
 String iterateId = "";
 String currentComponent = "";
    
 try {
 
   String currentMethodName = new Exception().getStackTrace().getMethodName();
   boolean resumeIt = currentMethodName.equals(resumeEntryMethodName);
   if( resumeEntryMethodName == null || resumeIt || globalResumeTicket){//start the resume
    globalResumeTicket = true;
     
  
/**
 * start
 */
ok_Hash.put("tFileList_1", false);
start_Hash.put("tFileList_1", System.currentTimeMillis());
currentComponent="tFileList_1";
 int tos_count_tFileList_1 = 0;
  
   
  String directory_tFileList_1 = "C:/Datenimport/Customer/FR1";
  java.util.List<String> maskList_tFileList_1 = new java.util.ArrayList<String>();
      maskList_tFileList_1.add(".*"); 
  int NB_FILEtFileList_1 = 0;
  for (String filemask_tFileList_1 : maskList_tFileList_1) {
   boolean case_sensitive_tFileList_1 = true;
 
    java.util.regex.Pattern fileNamePattern_tFileList_1 = java.util.regex.Pattern.compile(filemask_tFileList_1);
   
    if (!case_sensitive_tFileList_1){
      fileNamePattern_tFileList_1 = java.util.regex.Pattern.compile(filemask_tFileList_1, java.util.regex.Pattern.CASE_INSENSITIVE);
    }
    java.io.File file_tFileList_1 = new java.io.File(directory_tFileList_1);
    final java.util.List<java.io.File> list_tFileList_1 = new java.util.ArrayList<java.io.File>();
    
      file_tFileList_1.listFiles(new java.io.FilenameFilter() {
          public boolean accept(java.io.File dir, String name) {
              java.io.File file = new java.io.File(dir, name);
                list_tFileList_1.add(file);
              return true;
            }
          }
      );
    //int NB_FILEtFileList_1 = 0;
    java.io.File [] tempArray_tFileList_1 = list_tFileList_1.toArray(new java.io.File);
      java.util.Arrays.sort(tempArray_tFileList_1);
       
    java.util.List<java.io.File> fileList_tFileList_1 = new java.util.ArrayList<java.io.File>();
    fileList_tFileList_1 = java.util.Arrays.asList(tempArray_tFileList_1);
   
    for (int i_tFileList_1 = 0; i_tFileList_1 < fileList_tFileList_1.size(); i_tFileList_1++){
      java.io.File files_tFileList_1 = fileList_tFileList_1.get(i_tFileList_1);
      String fileName_tFileList_1 = files_tFileList_1.getName();
     
        if (!fileNamePattern_tFileList_1.matcher(fileName_tFileList_1).matches()){
          continue;
        }
      String currentFileName_tFileList_1 = files_tFileList_1.getName();
      String currentFilePath_tFileList_1 = files_tFileList_1.getAbsolutePath();
      String currentFileDirectory_tFileList_1 = files_tFileList_1.getParent();
      String currentFileExtension_tFileList_1 = null;
     
      if (files_tFileList_1.getName().contains(".") && files_tFileList_1.isFile()){
        currentFileExtension_tFileList_1 = files_tFileList_1.getName().substring(files_tFileList_1.getName().lastIndexOf(".") + 1);
      } else{
        currentFileExtension_tFileList_1 = "";
      }
     
      NB_FILEtFileList_1 ++;
      globalMap.put("tFileList_1_CURRENT_FILE", currentFileName_tFileList_1);
      globalMap.put("tFileList_1_CURRENT_FILEPATH", currentFilePath_tFileList_1);
      globalMap.put("tFileList_1_CURRENT_FILEDIRECTORY", currentFileDirectory_tFileList_1);
      globalMap.put("tFileList_1_CURRENT_FILEEXTENSION", currentFileExtension_tFileList_1);
      globalMap.put("tFileList_1_NB_FILE", NB_FILEtFileList_1);
 
/**
 * stop
 */
/**
 * start
 */
currentComponent="tFileList_1";
 
 tos_count_tFileList_1++;
/**
 * stop
 */
/**
 * start
 */
currentComponent="tFileList_1";
    }
  }
  globalMap.put("tFileList_1_NB_FILE", NB_FILEtFileList_1);
 
ok_Hash.put("tFileList_1", true);
end_Hash.put("tFileList_1", System.currentTimeMillis());
      if () {
       
       tOracleRow_1Process(globalMap);
      }

   
/**
 * stop
 */
}//end the resume
 
 } catch(Exception e) { 
  throw new TalendException(e, currentComponent, globalMap);
 
 } catch(java.lang.Error error) {
 
  throw new java.lang.Error(error);
 }
 
 globalMap.put("tFileList_1_SUBPROCESS_STATE", 1);
}

Accepted Solutions
Seventeen Stars

Re: [resolved] syntax error on token "(" exp expected: if statment seems to be wrong

It looks like an if trigger without an expression. Select the if trigger connection and take care you set an expression which returns a boolean like row1.value == 1  or  row5.name.equals("Max")

All Replies
Seventeen Stars

Re: [resolved] syntax error on token "(" exp expected: if statment seems to be wrong

It looks like an if trigger without an expression. Select the if trigger connection and take care you set an expression which returns a boolean like row1.value == 1  or  row5.name.equals("Max")
One Star

Re: [resolved] syntax error on token "(" exp expected: if statment seems to be wrong

Dear Jlolling,
indeed, after I extanded the if statment with a condition the ETL ran successfully. Issue solved!
Thank you! Have a nice weekend!
Best Regards,
Robert