How to save date with business object aggregation relation?

1
0
-1

How to save data in h2 database with business objects aggregation relation?

this is .bos:
https://drive.google.com/file/d/1zkiTYlwlfDI51E_LQPf8JnEJRE8Y0nQD/view?u...

after execution of this process , there are no data in H2 database?

Ps:
with business objects composite relation, i can found data in h2 but i need to use business object aggregation relation?

1 answer

1
0
-1

hi,

aggregation relation mean that attribute of this type must exist prior to add them.

in your .bos, object msh & pid must exists before your process start. use a dedicated process to create them, and then retrieve their internal id using a BDM query of your choice.

see https://documentation.bonitasoft.com/bonita/7.9/define-and-deploy-the-bdm for more information

def adA04Var = new com.company.model.AdA04() adA04Var.ada04seg = { //Retrieve aggregated Segment using its DAO and persistenceId def segmentVar = segmentDAO.findByPersistenceId(adaInput.ada04seg.persistenceId.toLong()) segmentVar.msh1 = { //Retrieve aggregated Msh using its DAO and persistenceId def mshVar = mshDAO.findByPersistenceId(adaInput.ada04seg.msh1.persistenceId.toLong()) mshVar.attribut1 = adaInput.ada04seg.msh1.attribut1 return mshVar}() segmentVar.pid1 = { //Retrieve aggregated Pid using its DAO and persistenceId def pidVar = pidDAO.findByPersistenceId(adaInput.ada04seg.pid1.persistenceId.toLong()) pidVar.attribut3 = adaInput.ada04seg.pid1.attribut3 return pidVar}() return segmentVar}() return adA04Var

Comments

Submitted by maouachria on Wed, 09/04/2019 - 11:58

thanks laurent;
please, have you any example (to set the business variable attributes values )?

Notifications