Before You Begin
This 15-minute tutorial shows how to create a web application in the visual application project that you created in the previous tutorial, Create a Project for Visual Applications in Visual Builder Studio. It also shows how to populate the web application with business objects.
Background
Web and mobile applications in VB Studio take shape within the Designer, a rich graphical user interface that lets you design and develop your application by dragging and dropping components on a page. Each component depends on a business object for its data. A business object is just a resource -- like a purchase order or invoice -- that has fields to hold your application's data. It is similar to a database table, as it provides the structure for your data; in fact, business objects are stored in a database. Your application accesses these business objects through their REST endpoints.
In this tutorial, you'll create the Employee, Department, and Location business objects for the HR web application. Each business object has its own set of fields as shown here:

Once you have your business objects, you'll use them to build the HR web application in which every employee belongs to a department, and every department has a location. Your goal is to allow your users to add employee names and their departments, and to change that data when necessary.
Note: Although this tutorial shows you how to build an application using a business object, you can also build applications based on REST services or on databases like Oracle Database Cloud Service. The basic principles of creating applications are the same, no matter what form your data takes.
What Do You Need?
- Access to VB Studio
- A supported browser (Google Chrome is recommended)
- Completion of the previous tutorial
Create a web application
Let's add your first web app to the HR Visual Application that you created in the previous tutorial. A visual application is a container for all your web and mobile applications. In this tutorial, we'll add a single web app to your visual application, but you could have more than one, even both web and mobile apps in the same visual application.
- On the Project Home page, click HR Visual Application under Workspaces.
The visual application opens on the Designer's Welcome page.
Description of the illustration visual_app_welcome.png The Welcome page contains a set of tiles in three groups: Connect to Data, Create Apps, and Add Artifacts.
On the far left are icons representing Mobile Applications, Web Applications, Services, Business Objects, Components, Processes, Source View, and Git Panel.
Take note of the header elements:
Description of the illustration header.png On the left is the name of your current workspace HR Visual Application; next to it is the project's Git repository and the branch currently associated with your workspace tutorial-hr-project.git / hrbranch. Click each option to see other actions that you can perform from here. Clicking
will take you back to the Project Home page.
Elements on the right let you perform various other actions. For example, you can undo your most recent change, redo a change after clicking Undo, or search the Git repository for a file. In this series, we'll mostly use the options to preview a page and publish changes.
- We want to create a web application, so under Create
Apps, let's click the Web Apps tile.
The Web Apps pane opens in the navigator.
Description of the illustration web_apps.png - Click + Web Application (or click the + sign at the top of the pane).
- In the Create Web Application window, enter
hrwebapp
as the Application Name. (You can specify uppercase as well as lowercase characters in the application name, but the name is converted to lowercase.) Leave the Navigation Style set to the default, None, and click Create.The application opens on the main-start page, which is automatically created for you. This is also the default name assigned to your application's home page. (If you run into the This dot says that you have made some changes message, ignore it; we'll explore Git changes in a later tutorial.)
Description of the illustration designer.png What you see under the main-start tab is your application's main work area. Just under main-start are several other tabs: Page Designer, Actions, Event Listeners, and so on. By default, the page opens in the Page Designer, showing the Components and the Structure tabs. To design your pages, you'll drag components from the Components palette to the canvas. Once you add components, the Structure view provides a structural view of the components on the canvas.
On the far right is the Properties pane, which lets you view or edit a component's properties. When the entire page is selected (as it is now), the Properties pane shows the Page view, where you can choose a preferred page layout. Click Properties (the vertical tab located along the right-most edge of your browser) to hide the properties pane and expand your work area.
In the Web Apps pane, expand the hrwebapp node, then the Flows and main nodes to get a tree view of your web application.
Import a Location Business Object From a File
Let's create our first business object and get data for it by importing a CSV file. Every business object needs data associated with it, and there are many ways to do that, as you'll see.
- Click Business Objects
in the navigator.
- Click + Business Object.
- In the New Business Object dialog box, enter
Location
in the Label field and click Create.Location
is also filled in automatically as the Name value. When you create a business object, specify the singular form of the noun. - Click Fields for the new Location business object. Every business object you
create has five default fields: an id, plus fields that
provide information on who created and updated the object
and when.
Description of the illustration location_bo_fields.png - Click + Field to add a field specific to this business object. This is a very simple business object, so we'll only add one new field.
- In the pop-up box, enter:
- Label:
Name
- Field Name:
name
(automatically populated) - Type: String
(selected by default)
Click Create Field.
Description of the illustration location_bo_name_field.png - Label:
- In the Name field's properties, select Required
under Constraints.
Description of the illustration location_bo_name_required.png A check mark is displayed in the Required column for the Name field.
- Click this
link and save the
Location.csv
file to your file system. This file contains data representing four locations for the application. - In the Business Objects pane, click Menu
and select Data Manager. The Data Manager is what you use to import data from a variety of sources.
Description of the illustration location_bo_data_manager.png - Click Import from File.
Description of the illustration location_bo_data_manager_import.png - In the Import Data dialog box, click the upload box,
browse to select
Location.csv
, and click Import. When the import succeeds, click Close.
Description of the illustration location_bo_import.png - In the Business Objects pane, click Location,
then Data to view the locations that were
added.
Description of the illustration location_bo_data.png In the next step, we'll associate these locations with the departments that are located on these floors.
Create a Department Business Object
Let's now create the Department business object, which will have fields to show a department's name and location. We'll set up the department's Location field to pull in data from the Location business object we created in the previous step, but we won't import data for the Department business object in this step.
- In the Business Objects pane, click the +
sign, then select Business Object.
Description of the illustration department_bo.png - In the New Business Object dialog box, enter
Department
in the Label field and click Create.Department
is also filled in automatically as the Name value. - Click Fields, then + Field.
- In the pop-up box, enter:
- Label:
Name
- Field Name:
name
(automatically populated) - Type: String
(selected by default)
Click Create Field.
- Label:
- In the Name
field's properties, select Required under Constraints.
A check mark is displayed in the Required column for the Name field.
- Click + Field again. In the pop-up
box, enter or select:
- Label:
Location
- Field Name:
location
(automatically populated) - Type: Reference
- Referenced Business Object:
Location
- Display Field:
Name
(automatically populated)
Click Create Field.
Description of the illustration department_bo_reference.png A Reference Type field refers to the key (the Id field) of another business object and links two business objects together. When you create a department now, you'll be able to select its Location (one of the floors). The Display Field indicates that Name (not Id) will be displayed.
- Label:
Create an Employee Business Object
In this step, we'll create the last business object we need, the Employee object, which contains employee names and identifying data. The Employee object also has a Reference type field that refers to the Department object.
- In the Business Objects pane, click the + sign and select Business Object.
- In the New Business Object dialog box, enter
Employee
in the Label field and click Create.Employee
is also filled in automatically as the Name value. - Click Fields, then + Field.
- In the pop-up box, enter:
- Label:
Name
- Field Name:
name
(automatically populated) - Type: String
(selected by default)
Click Create Field.
- Label:
- In the Name field's properties, select Required under Constraints.
- Click + Field again, then enter or select:
- Label:
Department
- Field Name:
department
(automatically populated) - Type: Reference
- Referenced Business Object:
Department
- Display Field:
Name
(automatically populated)
Click Create Field.
- Label:
- Click + Field again, then enter or select:
- Label:
Hire Date
- Field Name:
hireDate
(automatically populated) - Type: Date
Click Create Field.
- Label:
- Click + Field again, then enter or select:
- Label:
Email
- Field Name:
email
(automatically populated) - Type: Email
Click Create Field.
- Label:
- Click Endpoints to view the Resource
APIs and REST endpoints created for the Employee business
object. Because Employee refers to Department, you'll see
endpoints for both objects if you expand the departmentObject
node.
Description of the illustration employee_bo_endpoints.png - Click the getall_Employee endpoint to see an endpoint viewer, where you can perform operations on the endpoint. For example, you can
use the Test tab to test requests and view responses with specified parameter
values.
Description of the illustration employee_bo_endpoints_getall.png Click
Endpoints to return to the main Endpoints page.
- Expand the Resource APIs node to see the URLs for accessing the metadata and data for the business object, then minimize it again.
Create a Business Object Diagram
Now that we have our business objects, let's create a diagram that provides a visual representation of business objects and their relationships.
- In the Business Objects pane, click Diagrams,
then + Business Object Diagram.
Description of the illustration bo_diagram.png - In the Create Business Object Diagram dialog box, enter
HRDiagram
in the Diagram name field and click Create.An empty diagram page opens.
- In the Properties pane, click Select All
to see the three business objects you created and their
relationships.
Description of the illustration bo_diagram_selectall.png The diagram looks just like the graphic in the Before You Begin section.
So far, you've imported data only for the Location object. You'll add data for the Department and Employee business objects in later tutorials.