I have a transaction OrderPlace which takes list of supplier as input and creates an order.
transaction OrderPlace
{
o String orderId
--> Consumer consume
o OrderDetails details
--> Supplier[] supply
--> Commodity com1
}
The order is an asset having list of suppliers
asset Order identified by orderId {
o String orderId
o String orderName optional
o OrderState state
o OrderDetails details
--> SupplyOrder[] OrderSupply
--> Trader owner
--> Commodity com1
--> Consumer consume
--> Supplier[] supplier1
o Rating rating optional
}
This order is created when OrderPlaced transaction is called and that should create relationship between the list of suppliers.
I was trying the code below for a single supplier
order.supplier = factory.newRelationship(namespace, 'Supplier', OrderPlaced.supplier.getIdentifier());