Instantiate a Business Variable from an Operation

1
0
-1

I am trying to do a simple Business Object** Instantiate With** from a service task as a test.

This is the Script Im using create a new ErrorDetail object and return it back to the business variable.

import com.company.model.ErrorDetail;

ErrorDetail newDetail = new com.company.model.ErrorDetail();

newDetail.setAcid(1234);
newDetail.setTmsecid(22)
newDetail.setTmcode("tmcode")
newDetail.setTimestmp(new Date());
newDetail.setErrorseverity(4);
newDetail.setErrormsg("hello")
newDetail.setSource("source")
newDetail.setBpstatus(0);
return newDetail;

I get a hibernate error.

Is it actually possible to do this? I know you can set the default value and also set attributes from Contracts, but can you instantiate a new BO from within a script?

Has anyone gotten this to work in V7?

Thanks

1 answer

1
0
-1

Hi,

yes, you can. You should prefer to use ErrorDetailDAO.newInstance() instead of using the emptyu constructor.

Which error do you have? Are you sure that you don't forget to set a mandatory field? Are you sure that there isn't a "complex" atttributes?

Regards,

Notifications