Question
How to insert data into DB in case of nested cdt?
There is a requirement where i have to insert nested CDT(one to many) data into table and then read in another process model.
Parent CDT : policyDetails
policynumber
customerId
actiontype
nomineeDetails
Child CDT= nomineeDetails
{
title: "Mr",
forename: "abc",
surname: "Test One",
dateOfBirth: "01/01/2000",
percentage: 80,
relationship: "Brother",
addressLine1: "Hall Road"
}
{
title: "Mr",
forename: "xyz",
surname: "Test two",
dateOfBirth: "01/01/2006",
percentage: 50,
relationship: "sister",
addressLine1: "aaaaa",
}
My Approach :
- Create two tables policyDetails & nomineeDetails with foreign key = policynumber
- Insert policy details into first tables without nomineedetails.
- Insert nominee details into second table using MNI in process model.
- Create 2 expression rules to read data from both tables and use it.
Do you guys feel that there should be better approach?
