This example shows a simple FpML-based workflow orchestrated via Daml. It shows how messages are ingested, how to work with FpML data structures from Daml, and how to output FpML messages from the ledger. This example is compatible with version 5.10 of the FpML specification.
- The operator ingests a
RequestClearing
FpML message via theSubmitRequestClearing
choice on theClearingHouseRole
contract. - Party information is extracted from the message in Daml and
RequestAcknowledgementEvent
andRequestClearingEvent
contracts are created. - The application exercises the
DispatchRequestClearing
choice onRequestClearingEvent
providing contract ids of clearning member roles. - The
HandleRequestClearing
choice is exercised on bothClearingMemberRole
contracts, which generates the finalClearingConfirmedEvent
contracts.
- Install the Daml SDK
- Make sure to configure the Maven repository
- Java Integration Libarary
- Make sure to install the library locally using
mvn install -DskipTests
- Make sure to install the library locally using
- Scala SBT
To build the example:
daml build
To generate Markdown documentation for the FpML Daml sources:
daml damlc docs -o target -f Html daml/FpML/V510/Confirmation.daml
You can the open target/FpML-V510-Confirmation.md
to browse the documentation.
From the example root directory:
daml start
cd app
sbt "runMain com.digitalasset.app.Bots"
Then, in a separate console:
cd app
sbt "runMain com.digitalasset.app.REPL"
In the REPL:
send(requestClearing)
This will send the RequestClearing
message to the ledger, and display the resulting ClearingConfirmed
messages on the console.