• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Unresolved compilation error - Gregorian Date

#1 2010-08-06 13:35:16

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

[resolved] Unresolved compilation error - Gregorian Date

I have a custom routine that takes in a date, and 12 integer values (1 for each month).  The java for the routine seems fine on it's own, so I am wodering if is my date formatting on the input file.  The Date on the excel file is defined as "MM/dd/yyyy".  The error is highlighted on tMap but references the input file.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method calcConvYTD(LocalGregorianCalendar.Date, int, int, int, int, int, int, int, int, int, int, int, int) in the type calcConv is not applicable for the arguments (Date, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)

    at training_project.function_tester_0_1.function_tester.tFileInputExcel_1Process(function_tester.java:1663)
    at training_project.function_tester_0_1.function_tester.runJobInTOS(function_tester.java:1985)


Here is the function definition:
...
import sun.util.calendar.LocalGregorianCalendar.Date;
...
public static int calcConvYTD(Date convDate,
            int valMonth1,
            int valMonth2,
            int valMonth3,
            int valMonth4,
            int valMonth5,
            int valMonth6,
            int valMonth7,
            int valMonth8,
            int valMonth9,
            int valMonth10,
            int valMonth11,
            int valMonth12) {
       int lvndod = 0;
        if (convDate == null) {
            return 0;
        }

        else if (convDate.getMonth()==1){
        lvndod = valMonth1;
        return lvndod;
            }
        else if (convDate.getMonth()==2){
            lvndod = valMonth1 + valMonth2;
            return lvndod;
            }
        else if (convDate.getMonth()==3){
            lvndod = valMonth1 + valMonth2 + valMonth3;
            return lvndod;
            }
...
        else {lvndod = 0;
            return lvndod;
        }
    }

The expression builder call in tMap is in the attached image.

Thanks,
Ben

Offline

#2 2010-08-06 13:36:57

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: [resolved] Unresolved compilation error - Gregorian Date

The image didn't load, but this is the expression builder code:

calcConv.calcConvYTD(row4.IN_CONVDATE,  row4.valMonth1,  row4.valMonth2,  row4.valMonth3,  row4.valMonth4,  row4.valMonth5,  row4.valMonth6,  row4.valMonth7,  row4.valMonth8,  row4.valMonth9,  row4.valMonth10 , row4.valMonth11,  row4.valMonth12)

Offline

#3 2010-08-08 07:50:31

shong
Talend team
Registered: 2007-08-29
Posts: 10305
Website

Re: [resolved] Unresolved compilation error - Gregorian Date

Hi
As the error message shows, the input parameters are not correct for method calcConvYTD, it requires int type, but you pass Integer type. To correct it, uncheck the nullable box.

Best regards
Shong


Uploaded Images


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#4 2010-08-23 15:18:11

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: [resolved] Unresolved compilation error - Gregorian Date

Thanks, Shong.  As it turns out...the answer is really "learn java" wink.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Unresolved compilation error - Gregorian Date

Board footer

Powered by FluxBB