The business objects that you create in Visual Builder Cloud Service (VBCS) are quite powerful. Not only can they store data, manage relationships, and give you a rich REST interface for interacting with them, they can also execute dedicated business logic that deals with the data.
If you click on the Business Rules section of a business object you’ll see that you can create:
· Triggers – allow you to react to data events such as insert, update, and delete on records.
· Object and field Validators – allowing you to make sure that data at the field or record level is correct.
· Object Functions – A way to define "service methods" that encapsulate logic related to a business object. These functions can be invoked from various points in your application, and also from outside your app.
To code logic in any of these location you will leverage the Groovy language.
I wanted to show the power of some of the functionality you can achieve with these hook points for logic. The demo scenario below is based on a requirement we got from a customer to be able to send an email with the details of all the children records that belong to a specific master record. Imagine a scenario where we have travel requests associated with specific airlines. When we go to delete an airline we want to send an email that will notify someoe about the travel requests that are going to be impacted by this change.
To achieve this I used an accessor – an object that helps you traverse relationships between the two objects – to loop over the records and collect them. Read the complete article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.