Provide a Method to Calculate Values for Derived Attributes

Provide a Method to Calculate Values for Derived Attributes


Plex

This example will use the entity OrderDetail where a derived field will be added. Enter the following triple:

OrderProcessing.OrderDetail has a derived FLD LineTotal.


Generate Changes.

On the test Model there is an OrderProcessingbuildObjects list object that contains all the template generation functions for all the entities in the application.


After generating the OrderProcessingbuildObjects list we need to generate ApplicationServerObject that contains all the server objects of the application:


Eclipse

Now go to eclipse.

To import all the generated function right click and refresh the java project:


Then look for Custom Derived Calculations.inc. Add code for the derived field:


Then run the Application Generator:


When the application is running do the following:

  1. Click on Application Settings then on Apply:

  2. Click on Application Template, select Gen Folder, and Generate Application. Wait for the message that all was generated successfully.

Now right click and refresh the web project.


Run tomcat server.


Test Changes

See that Line Total is a derived attribute and is calculated. The calculation of line total is Quantity x Product Price.



    • Related Articles

    • How to add items with dual values on a combo box

      This tutorial show you how to create an item on a combo box that implements two values, one will be the key value of the item and the other would be the description of the item. You can achieve this by creating a custom API function to add the items ...
    • How to solve the Invalid method Code length issue?

      This issues is b/c  the Java code Hit Java limit, which human is impossible to hit but generator hits, this is Java limitation that does not exist in RPG, here is the information you will need in order to solve the issue in the specific functions but ...
    • Totals Calculation

      To implement this feature it is necessary to inherit from the ability to List Totals, which is done via the triple: MyEntity is a Ability.ListTotals. This will inherit a view 'TotalAttributes' which will be added any field(s) that need to be totaled. ...
    • CM evolveIT API Interface

      Overview Information managed in an evolveIT Inventory is available for access by 3rd Party applications via simple messaging architecture and a straightforward data access API. evolveIT provides a Service-Oriented Architecture. “Client” applications ...
    • Source Scanner for IBM Enterprise COBOL

      XML Elements This document describes the XML entities and relations the COBOL scanner creates on encountering various COBOL code constructs. CA_Repository_COBOL_Model XML document root element. Attributes: id - Unique element identifier. ...