Skip to main content

Defining additional features

With the core data structure complete, we can now look at extending the functionality of our Data Elements by defining application behavior through Options and Finders.

Adding a default value using options

In many business scenarios, proposing a default value during data entry saves user time. In Normalized Systems, this kind of extended functionality is provided by adding an Option to the relevant Data Element or Field.

Let us configure the brand field to suggest "Mercedes" as a default value when a new car record is being created.

Step 1: Open the Field editor

Open the detailed editor screen for the Car Data Element and select the brand field.

Step 2: Add the option

  1. Select the Add option feature for the field.
  2. From the dropdown menu listing all possible options, choose or type defaultValue.
  3. In the associated input field, enter the string value: Mercedes.
Note on Options

The availability and behavior of specific Options are often determined by the various Expanders (code generation plugins) and Plugins installed in your NS environment. The documentation for these specific components should be consulted to understand the full range of available functionality.

Adding search functionality with finders

For an application to be usable, we need a method for users to efficiently look up data records. In NS, this is achieved by creating Finder elements. A Finder specifies which fields can be used to search for particular instances of a Data Element.

Let us create a Finder that allows users to look up all cars of a specific brand.

Step 1: Initiate a new finder

Click the Car Data Element and select the New Finder option.

Step 2: Specify the search parameters

You must specify the field to be searched along with a Field Operator Pair.

Click on Add a field operator pair:

  • Field: Choose brand.
  • Operator: Specify the Lk operator (which typically stands for "Like," enabling partial or pattern-based searching).

The Micro Radiant will automatically suggest a name based on your choices: findByBrandLk. Accept this suggested name.

By defining this Finder, we instruct the NS Expanders to generate the necessary database queries and service layer code, allowing the application interface to present a search function for cars based on their brand.

Adding Document Uploads

We will now add a feature to enable customers to upload their driving license when making a booking.

Since we included the assets base component, our application is automatically provisioned with document management functionality. We simply need to create a Link Field from Person to the Asset Data Element within the assets component.

Add the following Link Field to the Person Data Element:

NameAdd to infoLinkFieldTargetElementTypeOptions
drivingLicenceassets::AssetLn02assets.upload.type::INTERNAL

By linking to the TargetElement assets::Asset and specifying the Option assets.upload.type::INTERNAL, the resulting web application will automatically generate a dedicated upload button and screen, allowing the customer to link documents to their Person record.


Congratulations!

You have successfully completed the initial modeling of the euRent car rental system within the Micro Radiant.