Explicit custom technical service on the basic runtime
This independent example compiles SPP business logic and explicitly binds the
user-supplied CallCounter through APP/PHY. It depends on the public generator
and basic runtime only. The counter observes service phases, stores no participant
facts and is not registered by the SDK. It does not implement request replay,
transaction coordination or production audit storage.
From the compiler workspace:
mvn -Pbasic,basic-example -pl :spp-custom-services-example -am test
Or install the public compiler/runtime first and run mvn test here. The test
executes the generated preview scenario, verifies its business result and the
before/after callbacks on both the scenario and atomic service. No login or
commercial module is required. Generated Java stays in target/.
The same source project also declares createRecord, readRecord and
reviseRecord. APP supplies the entry key, repository lookup and local
transaction deployment; PHY binds an H2 JDBC repository. The tests invoke these
generated scenarios and inspect the real table. They verify that a full update
writes an explicit null and that two updates from the same read baseline yield
one success and one PERSISTENCE_VERSION_CONFLICT. No official change tracker,
partial-update service or request coordinator is installed. The MyBatis library
is needed to compile the generated mapper interface; this example does not use
the official enhanced MyBatis adapter.
The generated readonly inquiry previewRecord reads an entry by key, checks
that it was identified and calculates a projected amount. Its H2 test verifies
the returned projection and the stored row.
The concurrent test uses the runtime's test-only barrier before applyRevision
so both requests have read the same version. Business field assignments and
transaction boundaries remain in SPP. This is a local H2 acceptance example,
not a distributed transaction or production database certification.
Sample source files
- pom.xml
- src/main/java/example/technical/CallCounter.java
- src/main/spp/ledger-admission.app
- src/main/spp/ledger-admission.spp
- src/main/spp/ledger-quantum.app
- src/main/spp/ledger-quantum.spp
- src/main/spp/ledger.app
- src/main/spp/ledger.phy
- src/main/spp/ledger.spp
- src/main/spp/positions.app
- src/main/spp/positions.phy
- src/main/spp/positions.spp
- src/main/spp/reserves.app
- src/main/spp/reserves.phy
- src/main/spp/reserves.spp
- src/test/composition/ComposeTest.java
- src/test/composition/flat/client.app
- src/test/composition/flat/client.phy
- src/test/composition/flat/client.spp
- src/test/composition/flat/provider.app
- src/test/composition/flat/provider.phy
- src/test/composition/flat/provider.spp
- src/test/composition/interleaved/client.app
- src/test/composition/interleaved/client.phy
- src/test/composition/interleaved/client.spp
- src/test/composition/interleaved/provider.app
- src/test/composition/interleaved/provider.phy
- src/test/composition/interleaved/provider.spp
- src/test/composition/nested/client.app
- src/test/composition/nested/client.phy
- src/test/composition/nested/client.spp
- src/test/composition/nested/provider.app
- src/test/composition/nested/provider.phy
- src/test/composition/nested/provider.spp
- src/test/composition/serial/client.app
- src/test/composition/serial/client.phy
- src/test/composition/serial/client.spp
- src/test/composition/serial/provider.app
- src/test/composition/serial/provider.phy
- src/test/composition/serial/provider.spp
- src/test/java/example/technical/AdmissionPlayTest.java
- src/test/java/example/technical/BasicPersistenceTest.java
- src/test/java/example/technical/CrossDomainQuantumTest.java
- src/test/java/example/technical/CustomServiceTest.java
- src/test/java/example/technical/LegacyFormTest.java
- src/test/java/example/technical/SameFieldTransferTest.java
- src/test/java/example/technical/TransactionCompositionTest.java
- src/test/resources/alternate-admission/ledger-admission.app
- test-alternate-admission.sh