Dynamically Populating BPM Web Form Dropdowns
Web Forms is one of the exciting new features of the recently released BPM 22.214.171.124. To really embrace the power of Web Forms, one must understand Forms Rules, which can give your forms dynamic behavior, such as showing a field or calculating a sum total. In this example, I'm going to show you how to use Form Rules to dynamically populate a dropdown (or list).
Step 1: Create the Web Form
Using Business Process Composer, create a new BPM Process called DynamicDropdown. Then create a new Web Form called DropdownForm. Add 2 dropdowns on the form: Country and City. Your form should look as follows:
Step 2: Add the Country Rule
Click the rules icon to toggle to the Form Rules:
Create a new rule and click the edit Rule icon , then create the rule PopulateCountry as follows:
If you're playing along at home, you are free to use the same public URL as it returns a list of 5 countries as JSON output (if you want your country added to the list, just let me know): https://java-trialaxkb.java.em1.oraclecloudapps.com/LOVHelper/jersey/listvalues/countries. Just note that you will also need to add the Oracle Cloud's certificate to your WebLogic KeyStore See Calling an Oracle Cloud Service from Java for details.
If you want to test run your form at this point, click the blue running man icon :
Step 3: Add the City Rule
It's very common to have the results of one field determine the contents of another. In this case we only want to see cities that apply to the selected country. Create a second Form Rule as follows:
And that's all there is to it: