Review of Brookstrut Sample App in APEX 23.2

Review of Brookstrut Sample App in APEX 23.2

That name, Brookstrut, seems to remind me of a very old APEX Sample App... hmm.. Upon further research, this app made an appearance as Sample Application in APEX 5.0 back in 2015.

So 9 years later... The Brookstrut Sample App makes another appearance in APEX 23.2. Here it is!

Note: The Store Locations Map card is hidden behind a Build Option, I'm not sure why, it seems to work fine. Just set the Maps Build Option to Include*.*

Brookstrut is available to download in the Gallery (proving you have APEX 23.2).

I was curious about this application because I has just read Chaitanya's post and within 18mins of him posting, I decided to write a blog. Why? because I was curious about this specific sentence

"Brookstrut ... analyzes a simplified stored data model and includes a feature to generate random data".

"Analyzes" ... What could this mean I thought? Was it using some SQL Workshop > Utilities > Data Generator feature? Have those APIs now being exposed? Was it using a Cloud AI Service to serve up a data model and AI was going to give me JSON data that we could insert into our tables? ... this Sample App couldn't install fast enough!!! I want to know how its works. This is so exciting.

My excitement was over in a flash... there's no data model analysis here whatsoever. It simply loops over the stores table (line 93) & products table (line 133), uses dbms_random a bunch of times (highlighted) and finally inserts into the sales_history table (line 162) which the application called Transactions (or it often calls it something else).

When you enter the app and click on Dashboard you can see 5000 Transactions which have been configured on install.

The theme style is a Dark Header variant of Redwood Light. Here you are, this is the entire style... and I like it to be honest.

    "classes": [
    "vars": {},
    "customCSS": "",
    "useCustomLess": "N"


Clicking on the the Navigation menu > Stores. Here we see a Faceted Search and the results are displayed as a Content Row which is Template Component belonging to the Theme i.e a Theme Component. It works really nice and the Content Row allows for an Action menu along with a Full Row Click. I've popped open the menu for you.

This allows a real low-code approach to designing such a feature rich design. The Theme Style and the Template Component really combine to give an awesome experience

In Page Designer, this is all it is... its impressive how so little configuration can make a beautiful UI for the users.

There's also this condition, but lets not talk about it too much ;-)

Clicking on the Content Row for a Store we can see Store Performance and Store Products

The Store Performance is a Classic Report with a Standard Template. Template Options have been used to Remove the UI Decoration. Under Attributes, the Value Attribute Pairs - Column template has been used.

So basically you supply a SQL selecting several columns and returning 1 row. The Value Attribute Pairs - Column template pivots the data in to a Header (which you define the text in APEX) and Value (which comes from your SQL statement).

The Store Products is also a Classic Report with a Standard Template. Template Options have also been used to Remove the UI Decoration.

See that screenshot above? Make a note of Coconut Water :-)


Nothing too special here, just an Interactive Report linking through to a Drawer on edit.

However clicking through a Product leads to a Smart Filters page which is nice to see. There is also a visual issue on the Select List here.

Wow. Look how many Coconut Waters there are!


Under Reports there are several IR based reports, a calendar and the Badge List Template makes an appearance under the Table Counts Report - check it out.

But whats this? API Calls? I excitedly head over to RESTful Services to check what REST services the installation created... and there is none. So whats this all about?

In another disappointing blow, It turns out the API, is actually the OOW_DEMO_HIST_GEN_LOG table. This is related to the Transaction Generation PL/SQL I posted above. So this API is just PL/SQL, which is called by using the APEX application.

This table is initially inserted into with some statistics about the data to be generated - it later updates this row with the the timings and actual number of inserts - all good practice.


Here the fun starts. If we head over to Transactions, we have several options.

Remove Transaction History

Here we can Remove our initial 5000 records. This screen calls them any of these three names

  • Transaction History

  • Transaction

  • History

... but they are all the same thing.

After clearing the history head back to our Dashboard and although the records are cleared, things look clunky.

Reset Sample Data

So here we can reset the sample data (ooh here is a 4th term) to t-shirt sizes. I wasn't sure if a 5XL T-shirt (XXXXXL) even exists, but after seeing this... I'm sure it does.

The way it works is interesting, clicking on S for example sets a page item P40_SIZE to value S. It then submits the page and branches to page 41, setting P40_SIZE to P41_SIZE in the process. Branching like this is good practice.

On Page 41, it translates the size into Max Records, Days and Orders. Then truncates the OOW_DEMO_SALES_HISTORY table.

Its a demo app, so truncating is the fastest way - not recommended for production apps (unless you have a valid reason of course).

It then generates the data using the PL/SQL above. Finally the rest of the page renders showing out much data it created.

Its a Classic Report using a Contextual Info Template - which I need to investigate further.

Generate Transaction

This page appears to create a single Transaction, but only for Coconut Water !!?? Every time I click it, it creates a single Coconut Water transaction

Generate Transaction on Page Load

This generates a Coconut Water transaction on an interval, e.g every minute

Interestingly, the generation results on this page blurt out a bunch of htp.p commands. This is unexpected as the modern approach for a Dynamic Content region is to return a CLOB of HTML to be displayed.

On closer inspection, its using the Legacy PL/SQL Dynamic Content region type. i.e the Old School approach.

Generate 100 Transactions on Page Load

This uses procedure oow_demo_gen_data_pkg.exec_100_transactions which, looping 100 times, both generates a single Coconut Water transaction and htp.p's HTML to the Legacy PL/SQL Dynamic Content region type.

Shared Components

There are a bunch of Plugin-in installed in this application from a bygone era, which are never utilized.

There's an application process which trims all page items on submit which is unusual

When I look at items like P12_ITEM_NAME its does not apply any native APEX trimming for some reason - perhaps that's why the Application Process exists?

The default for Page Items is Leading and Trailing. Perhaps all this is because its roots are in APEX 5.0 and this Trimming wasn't a native feature back then? my memory doesn't stretch that far back.


It's in interesting app. It appears to be an older application that has had a makeover, yet there's still remnants of the past.

Its data generation capabilities are far from analyzing a simplified stored data model.

Its not just a theme upgrade though. There's been some significant work to showcase the new features of APEX 23.2 and recent releases.

There's nothing groundbreaking in this application, however my suggested takeaways are:

  • Take from the application some inspiration from the use of Universal Theme components, Template component usage and styling. This application showcases them well.

  • Explore how this application uses the Content Row Template Component with actions, menus and links.

  • Investigate how the Faceted Search and Smart Filters are implemented and perhaps how they may feature in your application

Whats the picture? Its the cherry blossoms on The Stray in Harrogate in spring. Visit Yorkshire!