Was wondering if it’s possible to create custom methods for Business Data Model “objects” (ie classes)?
ie, instead of creating custom Groovy classes to operate on the BDM objects.
Simple example, create a new BDM object called User, with an attribute called UserId, String data type.
I want to create a method called SetUserId that will generate a GUID to fill UserId attribute.
Thanks!
BDM objects are POJO and this feature does not allow customization of the generated code.
Business logic should be part of the process definition (using object default value, task operations, connectors output mapping…) and is defined using Groovy script.
You can also create connectors with custom business logic that can update a business variable as part of connector output mapping. And from Bonita forms and pages you can call REST API extensions that can work with Bonita Engine API to get Business object values.
About your example, note that for each individual object of a given type Bonita generate a unique id. Attribute name is persistenceId
.