Suggested Approach

The MenuBar control rule uses an XML Stream rule to define the structure of a menu bar and the functions that each selected menu item executes. In a composite portal, styles and HTML parameter settings control the appearance of the menu. See Related Topics below for links to other articles about composite portals.

In this example, a simple menu offers users of the Emerald Club Membership Tracking application two top-level choices: Space and Actions. The Space submenu allows users to switch between two portal spaces — a Members space that helps them look up existing club members, and a Work space that allows them to start a workflow to enroll a new member:

Step 1: Create an XML Stream rule

Create an XML Stream rule with the third key part — the XML Type — set to "Menu". The other two key parts must be valid, but are arbitrary choice.

On the XML tab, clear the Auto-generated? check box. This allows you to enter an XML document directly, or use open authoring with Windows NotePad or an XML editor.

The createNewWork( ) JavaScript API function opens a New harness for a specified starter flow rule.

(Additional functions are in the standard text file rule named webwb.menuactionhandlers.js though some features of these functions are not available for the MenuBar control rule. Within a custom JavaScript function, you can call the pega.desktop.getCurrentSpaceName() function to return the name of the current space.)

Step 2: Reference the XML Stream rule in a menu bar section

1. Create a section rule to hold the menu. By convention, the Applies To class of section rules to be referenced in composite portals is Data-Portal, though this is not required.

You can adjust the dimensions of the section later to fit the menu and fit within panels of the harness rules that make up each portal space. You can present top-level menus horizontally (with submenus below, as in the Developer portal) or vertically, as in this example.

2. Create a freeform layout on the section containing a single cell.

3. Select and drag the Menu Bar control into the cell and drop it.

4. Click the magnifying glass icon at the right of the cell to open the Cell Properties panel.

5. Click the magnifying glass icon at the right of the Display As field to access HTML Property parameters for the MenuBar control rule.

Identify the XML Stream rule you created in Step 1 above through the three key parts: Class Name, Name, and XML Type. Select XML as the action. Click OK.

Step 3: Reference the section in a panel in each harness rule of the composite portal

In this example, the harness rule named Data-Portal.WorkSpace defines the content of a space named Work. This harness rule contains three panels: Top, Left, and Center. The Left panel references the section identified in step 2 above.

The second space Members is defined by a harness rule named Data-Portal.MemberSpace. Like the first harness rule, this has three panels. The contents of the Top and Left panel are the same as for the Work space.

The section in the right panel includes an embedded list view control to support a report display of Emerald Club members. (In this example, a placeholder report of operators-by-work-group appears.)

The portal rule references each space and identifies the Work as the default, as indicated by a radio button setting.

Step 4: Test and evolve

1. For thorough testing, do not open the composite portal as a secondary portal from your own (Developer) portal. Instead, create an operator ID associated with a dedicated access group that provides access to the composite portal.

2. Log in as an application user with the new Operator ID. The menu appears in the Left panel, as expected. The Work Space is empty.

3. Select the Actions > New Emerald Member menu option. The New work harness associated with the starter flow appears.

4. Select the Space > Members menu option to switch to the Member space. The list view report appears within the member space.

Have a question? Get answers now.

About Pegasystems

Pegasystems is the leader in cloud software for customer engagement and operational excellence. If you’ve driven a car, used a credit card, called a company for service, opened an account, flown on a plane, submitted a claim, or performed countless other everyday tasks, chances are you’ve interacted with Pega. For the past 30 years, our technology – CRM, digital process automation, robotics, AI, and more – has empowered the world’s leading companies to achieve breakthrough results.