Adding Determinations

This option allows you to create a determination.

Context

A business object requires the determination entity to detect changes made to node instances of a business object and then take appropriate actions.A determination describes a business logic that acts on any changes in the business object.

The framework generates default triggers when you add a determination. The generation of default triggers is based on the determination category. The default triggers vary according to the determination category that you select. The table below displays the default triggers for each category:

Default Triggers Category
Create and Update React after modification React before save Draw numbers during save React after successful save React after cleanup transaction React after failed save
Create, Update, and Load Calculate transient attributes
Determine React on check and determine

The framework executes a determination based on the trigger condition defined. The framework constantly checks the trigger condition at different points in the transaction based on the defined pattern of determination. For each determination, you need to specify the changes that generate the trigger condition. Changes can include creating, updating, deleting, or loading node instances. You have to carry out the following tasks to define a determination:

  • Add a Determination
  • Configure Triggers
  • Configure Dependency

Example

In the node instance of the invoice business object, if an end user changes the quantity of a product at runtime, the determination for updating the amount of the product is executed and the amount gets updated.

Prerequisite
  • You have already created a business object.

Procedure

  1. In the Project Explorer view, choose a business object.
  2. In the context menu, choose Open.

    The Overview page appears.

  3. Choose the Nodes page.
  4. Select a node.
  5. Press Ctrl + click to open the node Overview page.
  6. Choose Determinations page.
  7. Choose New.
  8. In the New Determination wizard, enter the following details:
    1. Name: Enter a name for the determination.
    2. Description: This is an optional field. Enter a short description of the purpose of the determination.
    3. Implementation Class: This class contains the determination implementation. The implementation class name is filled automatically when you enter a determination name. You can either choose an existing class or create a new one.
    4. Category: In this field, choose a category to generate the trigger condition. The various categories and their descriptions are as listed in the table below:
      Category Description Allowed Trigger Condition
      React after modification This is the default category. Choose this category to process the determination immediately after creating, updating, or deleting a node instance. Create, Update, and Delete
      Calculate properties Choose this category to create dynamic properties of business object node instances at runtime. Using this category, you can override static properties of business object node instances as long as these properties are not marked as being final. Example: Changing the property UPDATE_ENABLED to FALSE of a node instance if it has reached a certain state. none
      React on check and determine Choose this category to process the determination during the Check and Determine service whenever node instances of the corresponding node have been created, updated, or deleted in the transaction. Example: Resolve inconsistencies of a node instance. Determine
      React before save Choose this category to process the determination immediately before saving any changes made to a node instance. Create, Update, and Delete
      Draw numbers during save Choose this category to make last minute changes to the corresponding node before the transaction is saved. It has to be ensured that gapless IDs are used. For example, accounting documents. Create, Update, and Delete
      React after successful save Choose this category to process the determinations after node instances have been saved successfully. Create, Update, and Delete
      React after cleanup transaction Choose this category to process the determination after the transaction has been cleaned up. Create, Update, and Delete
      React after failed save Choose this category to process the determination after the save of the transaction has been rejected. Create, Update, and Delete
      Calculate transient attributes Choose this category to calculate transient attributes. The determination is processed before the consumer accesses a transient attribute of the corresponding node for the first time. In addition, determinations of this category are executed after a node instance has been modified. Create, Update, Delete, and Load
  9. Choose Finish.
  10. Configure triggers. This is a mandatory step. For more information, see
  11. Configure dependency. This is optional. For more information, see
  12. Choose (Check ABAP Development Object) from the toolbar and check the Problems view for any errors.
  13. To activate the business object, choose Edit > Activate ABAP Development Object.

    TIP

    You can also use (Activate ABAP Development Object) in the toolbar.