Skip to main content

Designing the subcase hierarchy

3 Tasks

1 hr 30 mins

Visible to: All users
Advanced Pega Platform 8.6 English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

The Front Stage application is constructed with a single event case and child cases for each service process. There are other decisions to make regarding the cardinality and instantiation of the child cases.

Analyze the key requirements for this application to determine the best design for the child cases and how the child cases are started. For each child case type, review any viable alternative designs listing the pros and cons of each. Produce a recommendation for the most appropriate child case structure for the application. Key requirements to consider are:

  • Processes – The weather prep, hotel rooms request, and parking functionality must execute independently.
  • Extensibility – It must be possible to specialize or extend the booking application to support different types of venues.
  • Reporting – Reports for events should be defined that display revenue, cost, and profit (profit by event type)
  • Data – Users must not be able to see financial information.
  • UI – Customer quotation, event manager review, and hotel booking screens.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Identify design options

Weather

Two options for the weather process are to:

  1. Always create the weather child case.
  2. Conditionally create the child case when precipitation is expected.

Option 1: Always create a weather child case

In this option, a weather subcase is always created for every approved event. The delay to wait for the weather check date-time is implemented in the weather case.

Option 2: Conditionally create a weather child case if precipitation is forecasted

In this option, the precipitation is checked by the Event case on the intended date-time. The weather child case is created if only there is precipitation in the forecast and weather preparation is required. This option can be implemented in one of four ways:

  • Pause the Event case by using a Wait shape until the desired date-time. Check the weather forecast. Conditionally create the weather case if precipitation is forecast.
  • Within a parallel or spin-off flow within the Event case, check the weather at the desired date-time. Conditionally create the weather case if precipitation is forecast.
  • Queue the check weather task to an agent. The agent performs the weather forecast at the desired date-time and conditionally creates the weather child case if precipitation is forecast.
  • Have a delayed Queue Processor check the weather forecast on the desired date-time. Conditionally create the weather child case if precipitation is forecast.

Parking

The parking case is straightforward and is conditionally created only when the parking service option is selected. Due to its simplicity, no other options are considered for this.

Hotel booking

There are at least two viable design options for the hotel rooms requests. The first is to create a single hotel services case that represents all hotel rooms request solicitations.  The second is to have multiple individual hotel rooms requests cases (one per solicited hotel).

Option 1: Single hotel case

A single hotel case is created when the hotel service option is selected. Data objects representing each hotel are contained in the hotel case.

Option 2: Hotel child cases per hotel

A separate hotel case is created per hotel solicited for rooms when the hotel service option is selected.  Child cases representing each solicited hotel are covered by the event booking parent case.

 

2 Evaluate design options

Weather

As shown in the following table, always creating a weather child case is more advantageous than conditionally creating a weather child case.

Design Pros Cons
Always creating a weather child case (Option 1)
  • All weather-related data and logic to obtain forecasts is contained in the weather child case 
  • Follows the separation of concerns strategy.
  • Encapsulates, modularizes, delegates complexity
  • A weather case is created unnecessarily if weather preparation is not required.
  • Depending on licensing model, this option may cost more.
Conditionally creating a weather child case (Option 2)
  • A weather child case is created only when required
  • The history leading up to the decision whether to create the weather child case is associated with the event case instead of the weather case

Parking

The parking case is straightforward and is conditionally created only when the parking service option is selected. Due to its simplicity, no other options are considered for this.

Hotel booking

As shown in the following table, creating a hotel child case per hotel is more advantageous than creating a single hotel case.

Design Pros Cons
Single hotel case
  • All hotel data is contained in one case
  • Calculations may be easier
  • Data security – Other hotels have potential access to data
  • Locking is an issue
Hotel child case per hotel
  • Locking is not an issue
  • UI requirement for hotel review is easily satisfied
  • Security
  • Greater number of hotel case instances to manage

3 Recommend the best design option

Weather child case

In keeping with the object-oriented programming encapsulation principle, the event case delegates every weather-related task to a weather case. By implementing weather as a separate child case, the potential exists to create a weather application on which any application, not just the Booking application, could use as a built-on application. If licensing is a concern, another option should be considered.

Hotel child cases

When a customer selects the Hotel Services option, multiple hotel child cases are created instead of a single hotel child case. A child case per hotel is preferred because:

  • Application locking requirements are fully satisfied.
  • UI requirements are easier to satisfy.
  • A child case per hotel design has greater specialization potential.

Parking child case

When the customer selects the Parking and Shuttle Services option, a single parking child case is created.

 



Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

67% found this content useful

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice