Hello, I am sorry to ask without making sure about the question.
I am developing a small to do task process.
I created multiple business object models with composition bdm.
In my UI, I can send the data as follows.
{
"timerObjInput": [
{
"recommandation": "Recommandation 1",
"timerTask": [
{
"title": "Task 1",
"startdate": "2019-02-07T00:00:00.000Z",
"enddate": "2019-02-07T00:00:00.000Z",
"statusTask": "None"
},
{
"title": "Task2",
"startdate": "2019-02-07T00:00:00.000Z",
"enddate": "2019-02-07T00:00:00.000Z",
"statusTask": "None"
}
],
"statusRec": "In process"
}
]
}
However, when I return the business variable the result is
recommandObj
[
{
"persistenceId": 165,
"persistenceId_string": "165",
"persistenceVersion": 0,
"persistenceVersion_string": "0",
"recommandation": "Recommandation 1",
"statusRec": "In process",
"links": [
{
"rel": "timerTask",
"href": "/API/bdm/businessData/com.company.model.TestTimer/165/timerTask"
}
]
}
]
I created a groovy script to add all data to BDM
def testTimerList = []
//For each item collected in multiple input
boolean status = false;
timerObjInput.each{
//Add a new composed testTimer instance
testTimerList.add({ currenttestTimerInput ->
def testTimerVar = new com.company.model.TestTimer()
testTimerVar.recommandation = currenttestTimerInput.recommandation
testTimerVar.statusRec = currenttestTimerInput.statusRec;
testTimerVar.timerTask = {
def timerTaskList = []
//For each item collected in multiple input
currenttestTimerInput.TimerTask.each{
//Add a new composed timerTask instance
timerTaskList.add({ currenttimerTaskInput ->
def timerTaskVar = new com.company.model.TimerTask()
timerTaskVar.title = currenttimerTaskInput.title
//timerTaskVar.setStartdate((new Date()).format('yyyy.MMMMM.dd hh:mm aaa'));
timerTaskVar.statusTask = currenttimerTaskInput.statusTask
timerTaskVar.startdate = currenttimerTaskInput.startdate
timerTaskVar.enddate = currenttimerTaskInput.enddate
return timerTaskVar
}(it))
}
return timerTaskList}()
return testTimerVar
}(it))
}
return testTimerList
How can I return the data what I send to the task?
Any help would be appriciated .
Thanks in advance.