You are on page 1of 6

CONSTANTS AND EXPRESSION RULES SKILLS PRACTICE SOLUTIONS 

In this skills practice, you will create constants and expression rules that will be used
throughout the Vehicle Fleet Management (VFM) application. ​Read all instructions carefully
and create all objects. After completing the entire exercise, review work from the skills practice
solutions document.

1. Begin by creating a parent-level folder for the Vehicle Fleet Management application
called ​VFM Rules and Constants​. Configure the appropriate security privileges for the
folder, allowing VFM Admin to make modifications to the folder and its contents as well
as modify security and VFM All Users to view the folder and its contents.
a. Create sub-level folders for VFM Constants, VFM Expression Rules, VFM Query
Rules and VFM Interface Rules. The sub-level folders can inherit security from
the parent folder without any overrides.
2. Within the VFM Constants folder create the following constants:
a. VFM_TASK_EXPIRATION_TIME_IN_HOURS​: Amount of time before a task
should automatically be cancelled. To ensure that processes do not remain in
memory for a significant amount of time, you can use this time to define an
exception flow. The constant value should be set to ​2​.
b. VFM_VEHICLE_CATEGORIES​: List of all vehicle categories. The multi-value
constant should include ​Small, Economy, Large, Luxury ​as values.
c. VFM_RETRY_APPROVAL_COUNTER​: Number of times a request to insert a
new vehicle can go back for more information before the request is automatically
denied. The constant value should be set to ​2​.
3. Within the VFM Expression Rules folder create the following expression rules:
a. VFM_IsVehicleDenied​: Based on the response from the supervisor and the
number of count of previous edits, determine whether the insert of a new vehicle
should be approved or denied. The input counter value should be compared to
the VFM_RETRY_APPROVAL_COUNTER constant, and if either the counter
input is above the constant or the supervisor chose deny, then this rule should
return true. Inputs are the counter value, which is a number (integer) and the
supervisor approval, which is a text value (possible values include Reject,
Approve, Request More Information). If decision=”Reject”, then expression
should return true.
b. VFM_CalculateNextServiceDate​: Given the date updated and the category of
vehicle, calculate the next service date of the vehicle. If the vehicle is a “Luxury”
vehicle, the next service date should be 3 months after the last updated date. All
other vehicles should have the next service date defined as 6 months after the
last updated date. Inputs are the vehicleType (text) and dateUpdated (date and
time). Output is the service date (date).
CREATING RULES AND CONSTANTS FOLDERS: 
To create a new folder, simply navigate to “New” and select “Folder” in the Application
Designer. You should create each of these folders as rule folders. Make sure to include
VFM Rules and Constants as the parent folder for the subfolders.

FOLDER SECURITY: 
To set folder security, select the checkbox next to the folder, and click the “Security” button.
Here you will have options to add groups for security.
CREATING CONSTANTS: 
To create a constant, navigate to “New” and select “Constant”. You can then fill in the
corresponding fields. Save the constant into your VFM Constants folder.
CREATING CONSTANTS WITH MULTIPLE VALUES: 
To create a constant with a list of values, select array and add values.

CREATING EXPRESSION RULES: 


To create an expression rule, go to “New” and select “Expression”. Save the expression
into your VFM Expression Rules folder.
Below is a possible expression to calculate whether or not the vehicle addition is denied.

Below is a possible expression to calculate the next service date based on vehicle type and
the last updated date.

You might also like