Problem com BDM with complex data

Description

I think there are problems in version 7.8.x community with BDM with complex data,
I imported the ExpenseReport 3.0 sample and it worked correctly,
when I try to replicate it doing zero, it gives error in the operation to write the information complex data (lines)

old function OK
import org.bonitasoft.engine.bpm.process.ProcessInstance;
import com.company.model.ExpenseReport;
import com.company.model.ExpenseReportLine;

ProcessInstance processInstance = apiAccessor.getProcessAPI (). GetProcessInstance (processInstanceId);

ExpenseReport newReport = new ExpenseReport ();
newReport.setIsApproved (false);
newReport.setSummary (reportContract.get ("summary"));
newReport.setCreationDate (new Date ());
newReport.setCreatedBy (processInstance.getStartedBy ());

List <Map <String, Object >> contractLines = reportContract.get ("lines");
List <ExpenseReportLine> lines = new ArrayList <ExpenseReportLine> ();
for (Map <String, Object> contractLine: contractLines)
{
ExpenseReportLine line = new ExpenseReportLine ();
line.setLabel (contractLine.get ("label"));
line.setCost (contractLine.get ("cost"));
lines.add (line);
}
newReport.setLines (lines);

return newReport;

new function with ERROR

expenseReportVar.summary = reportInput.summary
expenseReportVar.lines = {
def expenseReportLineList = []
// For each item collected in multiple input
reportInput.lines.each {
// Add aggregated ExpenseReportLine instance
expenseReportLineList.add ({currentExpenseReportLineInput ->
def expenseReportLineVar = expenseReportLineDAO.findByPersistenceId (currentExpenseReportLineInput.persistenceId.toLong ())
expenseReportLineVar.label = currentExpenseReportLineInput.label
expenseReportLineVar.cost = currentExpenseReportLineInput.cost
return expenseReportLineVar
} (it)
}
return expenseReportLineList} ()

Environment

windows 10

External Link

None

Workaround

None

Assignee

Antoine Mottier

Reporter

Paulo Azevedo

Affects versions

Reference

None

Fix versions

Configure