Skip to content

Product Configurator · Case study

When product choices depend on one another, each selection can change the next set of options. Your application needs to explain what can be chosen and what it would cost, while keeping that proposal separate from the configuration already saved.

Product Configurator demonstrates this interaction through Vector Workstations, a fictional hardware configurator. The application supplies the example catalog, specifications and prices; ExecKernel evaluates graph conditions and returns available actions. The integration uses local PHP.

We will follow a video configuration that exceeds a €1500 target, then replace its graphics card to finish at €1450. That change brings compatibility, price calculation, preview and confirmation into the same interaction.

Open the demo, choose Video production, select a €1500 budget and click Configure workstation.

On the first screen, select Core A5 · 12 cores. The Projected total becomes €520 while the Committed total remains €240. The initial €240 covers the case, cooler and SSD bundle; the extra €280 is the candidate processor’s price.

You can still change your mind. Click Confirm selection to save the processor. The application displays a component acknowledgement screen with an action to continue. That screen is also a graph node: confirming a part and moving to the next category are two explicit transitions.

On reaching motherboard selection, L4 Studio is blocked and A5 Studio is available. The saved processor supplied cpu_socket: "A5"; the L4 board’s condition requires "L4". The application presents the availability returned by the engine. Available only merely changes which cards the interface displays.

Complete this path, confirming each part and then continuing:

Category Example component Price
Processor Core A5 · 12 cores €280
Motherboard A5 Studio €180
Memory DDR5 · 64 GB €190
Graphics card Vector 16 · 16 GB €700
Power supply Power 850 W €140
Initial bundle Case, cooler and 1 TB SSD €240
Total €1730

The A5 motherboard constrains the memory choices to DDR5. The video profile allows the catalog’s 12 or 16 GB graphics cards, and Vector 16 requires the 850 W power supply. These relationships are defined by this example’s conditions, using illustrative parts and prices from its catalog.

At “Review the configuration,” node 60, the saved total is €1730 and the remaining budget is −€230. Finish within budget is blocked. You can explicitly accept the configuration above the target or reconsider the graphics card.

Review of the video configuration: €1730 committed total, €1500 target and €230 over budget. Finishing within budget is blocked; accepting the excess or reconsidering the graphics card is available.

The budget in this demo is a target that distinguishes two outcomes. It does not prevent selecting a component merely because the total exceeds that target. The configurator graph checks remaining_minor when finishing:

Same €1730 configuration Remaining budget Available completion action
€1500 target −€230 602: accept above budget, terminal 91
€2200 target €470 601: finish within budget, terminal 90

To try the second row, start a New build and repeat the same components with €2200. The demo has no “unlimited budget” mode: the comparison uses the targets offered by the application. Reconsidering the graphics card is available in both cases.

In the €1500 case, click Reconsider the graphics card. Edge 603 leads to node 70. You can replace the GPU once while retaining the power supply and all other components.

Select Vector 12 · 12 GB. The preview shows:

Value Saved configuration Vector 12 proposal
Graphics card Vector 16 · 16 GB Vector 12 · 12 GB
Total €1730 €1450
Remaining budget −€230 €50
Price difference −€280

This applies the mechanism introduced in Context updates and candidate values: the engine can evaluate a proposed update without modifying the session state. The application keeps both results visible so that the person can understand the effect before confirming.

At this stage, Vector 8 is blocked by the video profile. Vector 16 is blocked as a replacement because it was the initial choice; a separate action keeps it. Vector 12 satisfies the profile and the 850 W supply already saved.

The backend resolves gpu-12 from its own catalog. For this replacement, it prepares the following context update, with money expressed in cents:

{
"choice": "gpu-12",
"gpu_id": "gpu-12",
"gpu_vram_gb": 12,
"gpu_min_psu_w": 650,
"total_minor": 145000,
"remaining_minor": 5000
}

choice associates the proposal with that component’s edge. gpu_id identifies the part that would be selected, and its specifications provide facts for evaluating conditions. The profile, budget, power supply and initial GPU identifier remain from the existing context.

The application calculates the amounts. In backend/src/CaseService.php, candidate() has already resolved the part and prepared $patch before executing this fragment:

$context = $state->context->toArray();
$summary = $this->configuration(array_replace($context, $patch));
$patch['total_minor'] = $summary['totalMinor'];
$patch['remaining_minor'] = $summary['remainingMinor'];

configuration() adds the initial bundle and the parts identified in the proposed context. Replacing gpu_id makes it count the new graphics card instead of the previous one. The total therefore decreases by €280 rather than adding the price of another card.

Querying availability and confirming are different operations

Section titled “Querying availability and confirming are different operations”

To prepare a category’s cards, the backend evaluates each candidate independently from the same saved revision. In preview(), $state is that state, $patch contains the candidate facts and $this->graph is the loaded definition:

$raw = $this->engine->getPayload(
$this->graph,
$state,
$lang,
contextUpdates: new Context($patch),
);

This direct engine query returns a payload calculated with the candidate. The backend extracts the edge associated with the part and returns its availability alongside the projected total and price difference. The interface combines that response with catalog names, illustrations and specifications.

Reading the saved payload once for all parts would not be enough: each candidate supplies a different choice and different facts. Querying them separately lets the application show, for example, one board as blocked and another as available without saving either.

When Confirm selection is clicked, the backend resolves the candidate again and checks the case revision. It then uses the pattern from the Local PHP SDK: recover a session through resume(), then request navigation that the adapter persists.

$dto = $client->resume($row['engine_id'], $lang);
// ...
$client->navigate($dto, $edge, $patch);

$row is the application’s case record and contains the internal session identifier. $edge is the edge associated with the selected part. Availability in a preview does not replace evaluation when confirming.

In our path, selecting Vector 12 follows 702 to component acknowledgement node 1702. The next action, 2702, reaches final review 80. The summary now displays €1450 as the committed total. From there, 801 finishes within budget at 90.

Reconsideration subgraph: review 60 can accept the excess through 602 or reconsider through 603. Vector 12 follows 702 to 1702 and 2702 to review 80; with €50 remaining, 801 leads to terminal 90.

Final configuration after replacing the graphics card: €1450 committed total, €50 remaining and Vector 12 saved. The result states that no order has been placed.

The final review does not offer another reconsideration. The history retains both the initial choice and the replacement; context keeps initial_gpu_id: "gpu-16" and gpu_id: "gpu-12". This distinguishes what was there before from the part ultimately selected.

What the application connects around the engine

Section titled “What the application connects around the engine”
Responsibility Implementation in this case
Catalog and prices The application loads the fixture, resolves identifiers and calculates totals, remaining budget and differences
Compatibility and outcomes The graph checks socket, memory, profile, power supply and budget on the relevant edges
Preview The backend queries the engine with each candidate; the interface separates projected and saved values
Persistence and recovery The local PHP SDK uses a filesystem session store; the application case record lives in SQLite
Presentation React draws the parts, displays amounts and turns payload actions into controls

The case record retains the owner, profile, budget and association with the session. The session holds context, node and history. On reload, the application restores the saved state and checks that it still matches the catalog and graph in use.

The Technical inspector displays the graph and committed session. While a candidate part is on screen, open it to check that the proposal has not yet become part of the saved state.

The terminal result completes the example configuration. Turning it into an order would require application business logic for commercial pricing, inventory, purchasing and payment. This case teaches how to connect catalog data, engine evaluation and visible decisions while keeping a proposal distinct from a confirmed selection.