Date type constructor not matching error ( Could not find matching constructor for java.time.LocalDate(java.util.Date))

1
0
-1

Hello,
I created a complex input example task.
I created bdm
timerTask : title(TEXT)/ startdate (DATEONLY)/enddate(DATEONLY)
testTimer : recommandation(TEXT)/ task (timerTask)
The contract is

timerObjInput (COMPLEX)(Multiple)
recommandation (TEXT)
task (COMPLEX)(Multiple)
title(TEXT)
startDate(DATEONLY)
endDate(DATEONLY)

In the operation tab, I initiated timerObj to addAll as below.

def testTimerList = []
//For each item collected in multiple input
timerObjInput.each{
//Add a new composed testTimer instance
testTimerList.add({ currenttestTimerInput ->
def testTimerVar = new com.company.model.testTimer()
testTimerVar.recommandation = currenttestTimerInput.recommandation
testTimerVar.task = {
def timerTaskVar = new com.company.model.timerTask()
timerTaskVar.title = currenttestTimerInput.task.title
timerTaskVar.startdate = currenttestTimerInput.task.startdate
timerTaskVar.enddate = currenttestTimerInput.task.enddate
return timerTaskVar}()
return testTimerVar
}(it))
}
return testTimerList

However, I got the error as below

Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '[Sun Feb 03 19:00:00 EST 2019]' with class 'java.util.ArrayList' to class 'java.time.LocalDate' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.time.LocalDate(java.util.Date)

Any help would be appreciated.
Thanks in advanced.

sample TimerSample-1.0.bos file updated here

Comments

Submitted by antoine.mottier on Tue, 02/12/2019 - 19:53

Can you share your .bos file for example on Google Drive or Dropbox?

No answers yet.
Notifications