Hi, my name is Phoebe He.
I am a curriculum developer at Oracle.
In this demo, I will show you what web form rules can do,
and how to create a simple web form rule.
The TravelRequestApp application we will use for this demo automates a simple process for submitting and approving travel expenses.
The employee submits a travel request,
and Approval Rules determines whether this request needs manual approval by the manager based on the total travel request amount.
If the manager rejects the request, it goes back to the employee.
Otherwise it is approved, and the request is saved.
Let's take a look at how this application would look to the end user.
Assume you have deployed the TravelRequestApp application.
Let's log into Business Process Workspace as eheming, an employee.
From the Applications view, he selects TravelRequestProcess to kick off the process.
The Travel Request form opens.
He has to fill in his name, the date
trip details such as where he is going and why,
and expense details such as expected airfare and hotel expenses.
You can recognize some basic web form design elements here, such as text fields, tabs, dropdown menus and Radio buttons.
It's not obvious from looking at the form, but several fields have web form rules, making this a dynamic web form.
Let's explore these rules one by one.
For example, there are rules that dynamically populate the list of the options in both the Country and City dropdown menus based on current values in the database.
In fact, the City field dynamically populates the list of cities based on the value you’ve chosen in the Country field.
There's another web form rule that displays the Customer Name field if and only if you choose Customer Visit, so you can enter the customer name.
And there's also a web form rule that automatically calculatesTotal Amount based on the sum of amounts you enter on the Expense Details tab.
In fact, you cannot manually input a value in the Total Amount field —that field is grayed out. Only the rule can write to that field.
These are just a few examples of what web form rules can do.
In this demo, you’ve seen that web form rules can dynamically populate the list of options in a dropdown menu, display fields when certain options are selected, and perform calculations.
You can also use web form rules to pre-populate fields in the form based on the current user, clear all the fields in a form with a single click, and much more!
Now that you have a basic understanding of what web form rules can do,
I'd like to show you how simple it is to create a rule,
specifically, the rule that displays the Customer Name field when the user selects the Customer Visit option.
In Business Process Composer, assume you have created the TravelRequestForm and added the fields shown here.
Notice that the default setting for the Customer Name field has been set to not visible.
This means that by default, it will not be displayed.
Recall that you want this field to be visible if the user selects Customer Visit.
To create a web form rule, start by clicking the “rules” button to open the rules editing page.
Click the plus sign to create a new rule.
Name the rule and type a brief description to remind you what this rule does.
In the Rule field, enter the Javascript code to make the Customer Name field visible if Customer Visit is selected.
First, check whether the Customer Visit option has been selected in the Purpose of Visit field.
If so, set the visible property of the Customer Name field to true.
Otherwise, set it to false.
To test how the rule works, click the “test” button.
In the Purpose of Visit field, select Training. The Customer Name field should not show up.
Now, select Customer Visit. The Customer Name field appears.
Your web form rule works!
Hopefully you now understand what web form rules can do, and how to create a simple web form rule!
I am Phoebe He. Thanks for watching!