Commodity Network
This Business Network illustrates commodity trading.
This business network defines:
Participant
Regulator
Participant
Trader
Asset
Commodity
Transaction(s)
Transaction
Event
TradeNotification
To test this Business Network Definition in the Test tab:
Create two Trader
participants:
{
"$class": "org.acme.trading.Trader",
"tradeId": "TRADER1",
"firstName": "Jenny",
"lastName": "Jones"
}
{
"$class": "org.acme.trading.Trader",
"tradeId": "TRADER2",
"firstName": "Amy",
"lastName": "Williams"
}
Create a Commodity
asset:
{
"$class": "org.acme.trading.Commodity",
"tradingSymbol": "ABC",
"description": "Test commodity",
"mainExchange": "Euronext",
"quantity": 72.297,
"owner": "resource:org.acme.trading.Trader#TRADER1"
}
Submit a Trade
transaction:
{
"$class": "org.acme.trading.Trade",
"commodity": "resource:org.acme.trading.Commodity#ABC",
"newOwner": "resource:org.acme.trading.Trader#TRADER2"
}
After submitting this transaction, you should now see the transaction in the transaction registry. As a result, the owner of the commodity ABC
should now be owned TRADER2
in the Asset Registry.
Congratulations!
Summaries
Asset Definition
Namespace | Name | Description |
---|---|---|
org.acme.trading.SampleAsset | SampleAsset | An asset named SampleAsset |
org.acme.trading.Commodity | Commodity | An asset named Commodity |
org.acme.trading.AnotherCommodity | AnotherCommodity | An asset named AnotherCommodity |
Transaction Definition
Namespace | Name | Description |
---|---|---|
org.acme.trading.Trade | Trade | A transaction named Trade |
org.acme.trading.TraderById | TraderById | A transaction named TraderById |
org.acme.trading.BulkTrade | BulkTrade | A transaction named BulkTrade |
org.acme.trading.RemoveHighQuantityCommodities | RemoveHighQuantityCommodities | A transaction named RemoveHighQuantityCommodities |
org.acme.trading._demoSetup | _demoSetup | A transaction named _demoSetup |
Participant Definition
Namespace | Name | Description |
---|---|---|
org.acme.trading.Trader | Trader | An participant named Trader |
org.acme.trading.Regulator | Regulator | An participant named Regulator |
ACL
Queries
- Select all commodities
- Select all commodities based on their main exchange
- Select all commodities based on their owner
- Select commodities based on quantity