Customizing server code

After creating the new LU's we must add some important business logic to these.

Change business logic on CompanyCar

Changing business logic for new entity CompanyCar. Open the customization CompanyCar-Cust.plsql file in Developer Studio.

Change an error message

If you want to change a standard error message you can do that by overriding the specific standard error message method. In this case we want to write the registration number in the error message since this is not the standard behavior we override the method. An overridden method must have a super call, otherwise it is not an overridden method. The example below is an example of an pre-override of a method, this means that this code is run before the other code is run.

Change business logic check

In this example we have added post-override code to a method. This means that this code runs after the previous layers code. Here we have added some business logic that checks that we don't buy to expensive cars to our company.

Add some new business logic

Here we have added some new business logic that can be called from a client to calculate the price of a car. Since this is a completely new method we don't need to add any annotation before the method regarding overtake and override. Other annotations might occur, like security annotations.

Change business logic on PersonInfo

Reference Check

When you added the reference to CompanyCar from PersonInfo you received some new code in the template. This code check if it is a correct reference in method Check_Common.

New business logic

In this case we want to add a new business rule that checks that a car only can be assigned to one person. We do this by adding a new method called Check_Car and the we call this method from Check_Common which means that we have to do an override of Check_Common.