My model.cto file -
namespace org.acme.mynetwork
participant Client identified by ClientId {
o String ClientId
o String ClientName
o String[] Policies
o String[] RFQAraay
}
participant Insurer identified by InsurerId {
o String InsurerId
o String InsurerName
o String[] RFQArray
o String[] Quotes
o String[] Policies
}
asset RFQ identified by RFQId {
o String RFQId
o String ClientId
o String InsurerName
o String TypeOfInsurance
o String RiskAmunt
o String Status
o String currentOwner
o String[] Quotes
o String[] SelectedInsurer
o String LeadInsurer
o String[] FinalInsurer
}
participant Broker identified by BrokerId {
o String BrokerId
o String BrokerName
o String[] Clients
}
asset Quote identified by QuoteId {
o String QuoteId
o String InsurerName
o String InsurerId
o String Premium
o String Capacity
o String RFQId
}
transaction GenerateRFQ {
o String RFQId
o String ClientId
o String InsurerName
o String TypeOfInsurance
o String RiskAmount
o String[] InsurerAddresses
}
My Script.js file
/**
* Insurance script file
* @param {org.acme.mynetwork.GenerateRFQ} generate - the trade to be processed
* @transaction
*/
function generateRFQ(generate){
var RFQId = generate.RFQId ;
var today = new Date();
var y = today.getFullYear();
var m = today.getMonth();
var d = today.getDate();
return getAssetRegistry('org.acme.mynetwork.RFQ').then(function(assetRegistry){
var RFQregistry = assetRegistry;
RFQregistry.RFQId = generate.RFQId;
RFQregistry.ClientId = generate.ClientId
RFQregistry.InsuredName = generate.InsurerName;
RFQregistry.TypeOfInsurance = generate.TypeOfInsurance;
RFQregistry.RiskAmount = generate.RiskAmount;
RFQregistry.Status = "RFQ fired on "+ d + m + y;
RFQregistry. Insurer = generate.InsurerAddresses;
return assetRegistry.update(RFQregistry);
})
}
I'm using online playground. Submitting this transaction gives me an error:
Could not find any functions to execute for transaction org.acme.mynetwork.GenerateRFQ#ae28a855-ba3c-48fe-9404-291ad95b24c7
I've tried changing its name but still no good. However SampleTransaction business logic is working fine.