S++Core systems, human-reviewable
ENGLISH EDITION · OCTOBER 15, 2026
ContentsComplete book

Chapter 17 — Serial and Parallel Scenarios and Contract Formation

© 2026 S++ project contributors. All rights reserved. Book copyright.

A Scenario expresses one defined business activity through explicit participants, qualifications, dependencies and commit boundaries.

Reading a Funding Scenario

From wallet funding source:

Scenario serial fundShopWallet(
    Buyer, SettlementAccount, WalletFundingAgreement) {
    checkBuyerCredential; checkFundingAmount; prepareWalletFunding;
    parallel { findBuyer; findSettlementAccount; }
    identify(buyer); identify(settlementAccount);
    transaction {
        transferWalletFunds bounds {
            settlementAccount.balance: [null, null];
            buyer.wallet: [0, null];
        };
    }
}

Inputs identify buyer, source account and agreement; the body names them buyer, settlementAccount and walletFundingAgreement. Credentials and amount are checked, relationships prepared, then both sides queried concurrently. After identity confirmation, the explicit transaction executes fund transfer with the bounds declared at the call: the wallet's lower bound, and an explicit [null, null] for the settlement account, because every position a call can debit needs a bound and an unlimited one says so. A scenario that only reads is declared readonly Scenario, and the compiler rejects any update in it.

Contracts in Scenarios

WalletFundingAgreement expresses parties and amount; ShopOrder ordering; ReturnRequestAgreement a return request. A contract corresponds to a defined activity, not an arbitrary wrapper for a list or return object.

Later activities reference existing contracts. Payment uses an order; returns use the original order and reason. This preserves relationships without invoking the original scenario again.

Explicit Orchestration and Automatic Binding

Argument-free calls reduce repeated names without removing participants. The compiler finds unique type bindings; multiple instances need explicit arguments. Readability cannot depend on guessing ambiguity.

Serial groups express order and parallel groups overlap execution. Inputs and effects must be established first; plans also check deployment support and recovery capabilities.

A Reviewable Business Entry

A scenario should correspond to a named activity. Packing many actions into a generic command string hides eligibility and participant scope inside branches. Separate payment, shipping and return entries state their facts more clearly.

Scenarios turn combinations into readable business narratives. The next part explains identity, storage, transactions and resources that honor them.


Part Contents · Full Book Contents · Previous Chapter · Next Chapter