RBD provides support for EGL Web Transaction, offering a basic web interface for user I/O. When you generate a VGWebTransaction program for a web project, it creates several.JSP files in which EGLWebStartup.jsp, a web page displays a list of your VGWebTransaction programs. We can select a program and execute it. Finally, we can see the record data on the webpage.
The central idea of web transactions is like the one behind Text UI:
- VGWebTransaction program (comparable to a Text UI program) presents a web page for user input.
- The web page is based on a VGUIRecord (comparable to a Text UI form). EGL transforms fields in the record into controls on the web page, using field properties to determine the type of control to create.
This blog shows how the EGL Web Transaction supports Web projects.
Steps to Create Web Project with EGL Web Transaction Support
Step 1: Create a Web Project
Follow the below steps to create a web project:
1. Navigate to File->New->EGL project.

2. EGL Project window will appear.
3. Enter the Project name.

4. Select the Web Project option and click Next.
5. Select Apache Tomcat from dropdown.

6. Click Finish.
Web project has been created as shown below.

Step 2: Enable EGL support with Legacy Web Transactions
Follow the below steps to enable EGL support with legacy web transactions:
1. Go to Project Explorer.
2. Under Project Explorer, right-click the simple web.
3. Select Properties.
4. Properties for simpleWeb window will appear.
5. Navigate to Project Facets.
6. Select EGL support with Legacy web Transactions checkbox.
7. Click Apply and then OK.

Step 3: Creating an EGL Record
Follow the below steps to create an EGL Record:
1. Go to Project Explorer.
2. Under the Project Explorer, navigate to simpleweb->EGLSource.
3. Right-click the EGLSource.
4. Go to New->Recored.

5. A new EGL Record window will appear.
6. Enter the Package name and EGL source file name.
7. Click Next.
8. Select Basic.
9. Click Finish.

PAGE01.egl file has been created with the default code as shown below.

Step 4: Define VGUI Record
Follow the below steps to Define Record:
1. Open PAGE01.egl file.
2. Write the code below in the PAGE01.egl file.
3. Define the VGUI record with three fields, Name, ID, and Status, and add their attributes. (Change the Basic Record to VGUIRecord) as shown in the below image.
Source Code:
Record PAGE01 type VGUIRecord {
help = " PAGE01 HELP TEXT ",
title = " PAGE01 TITLE TEXT "
}
10 NAME char(32) {
displayName = "Enter Name:* ",
help = " NAME HELP TEXT ",
uiType = inputOutput
};
10 ID int {
displayName = "Enter ID:* ",
uiType = inputOutput
};
10 STATUS char(32) {
displayName = "Status:** ",
uiType = output
};
end
Program screenshot:

Step 5: Create a Program by selecting the EGL WebTransaction option
Follow the below steps to create an EGL WebTransaction:
1. Go to Project Explorer.
2. Under the Project Explorer, navigate to simpleweb->EGLSource.
3. Right-click the EGLSource.
4. Go to New->Program and press Enter.
5. A new EGL Program window will appear.
6. Enter the Package name (my. pkg) and EGL source file name (PGM01).
7. Select VG Web Transaction –> Create a VisualAge Generator style web transaction program.
8. Click Finish.

PGM01 file has been created with the default code as shown below.

Step 6: Assign values to Record fields
1. Write the code below in the PGM01.egl file.
2. Here, we assign values to the PAGE01 record fields using the record variable page01.
3. Save the project
Source Code:
program PGM01 type VGWebTransaction {}
page01 PAGE01;
function main()
page01.STATUS ="SmokeTest PGM01 Success!";
page01.NAME ="Moken";
page01.ID=1;
show page01;
end
end
Program screenshot:

Step 7: Generate the Project
Follow the below steps to generate the project:
1. Go to Project Explorer.
2. Under the Project Explorer, right-click the simpleweb and select Generate.

Project has been generated without errors as shown below.

Step 8: Run EGLWebStartup.jsp
Follow the below steps to run EGL WebStartup.jsp:
1. Go to Project Explorer.
2. Under the Project Explorer, navigate to simpleweb->WebContent->EGLWebStartup.jsp
3. Right-click the EGLWebStartup.jsp.
4. Go to Run As->Run on Server.

5. The project will be deployed, and the endpoint will be opened in an internal browser.
6. Select and Execute PGM01.

Output: In the test program, we assigned values to the record fields using the record variable and displayed record data on the Web page.

This blog shows that Web Transaction in RBD is a great feature to support a web interface for user inputs. This feature allows us to access and initialize the record fields and display them as output on a webpage.
Note: We can create EGL WebTransaction Project with Tomcat Server as well.
Lenka Suresh
QA Engineer – RBD