Skip to content

Server to Server Interaction

This section describes standard mechanisms as to how to create, update or remove records internally in the server. Implementation methods, New___, Modify___ and Remove___, exist to handle data manipulation through records in the server.

Data transport

Data transport is done with the table record interface in the server. Please do not list all attributes as parameters!

Server records

The server uses records instead of the Attribute Strings. A server record is defined as:

  • record_   <table_name>%ROWTYPE;

This declaration means that all columns in the table exists in the record.

Public Records

Public Records are a type of server record that only contains the public attributes of an entity.

Fetching data

The server should fetch data into records from views/tables, or call the Get method to fetch the public record. Each public attribute also has a Get_<attribute> method for fetching just that attribute value.

Manipulating data within an entity

The actions New___, Modify___ and Remove___  are used for manipulating data. Note! These methods have triple underscores, and they should not be mixed up with the client interaction methods having double underscores.

Creating a new record

A new record is created as follows:

  1. Create a record
  2. Call the Prepare_New___ method for setting entity default values.
  3. Update additional attributes.
  4. Call the New___ method.

Modifying a record

A record is modified as follows:

  1. Fetch the old record, by calling the Get_Object_By_Keys___ method.
  2. Update the records with new values.
  3. Call the Modify___ method with the updated record.

Removing a record

A record is removed like this:

  1. Call the Remove___ method. When calling this method, only the key attributes of the record are necessary to include.

Manipulating data from other logical units

If you want to create, modify or remove records in another entity, the target entity must expose a public method to do the operation. For client interactions there are generic interfaces for creating, modifying and removing data but no corresponding methods exist for server to server calls, and there should not be such generic interfaces either. Do not expose the server methods New___, Modify___ and Remove___ as public New, Modify or Remove methods. Instead you should create a more specific interface called something similar to what you want to do. For example, a method called Create_Order_Line could be implemented in an entity called OrderLine. This method should then call the server method New___ in the OrderLine entity.