my model is this:
namespace org.acme.mynetwork
asset Sensor identified by assetID {
o String assetID
o String Frequency
o String longitude
o String latutide
o String name
--> Spectrum range
}
participant Spectrum identified by SpectrumId {
o String SpectrumId
o String Spectrumval
}
transaction SpectrumChange {
--> Sensor sensor
--> Spectrum newrange
}
My sample.js file contains:
/**
* Track the trade of a commodity from one trader to another
* @param {org.acme.mynetwork.SpectrumChange} Change - the spectrum to be processed
* @transaction
*/
function Spectrumupdate(spectrumChange) {
spectrumChange.sensor.range = spectrumChange.newrange;
return getAssetRegistry('org.acme.mynetwork.Sensor')
.then(function (assetRegistry) {
return assetRegistry.update(spectrumChange.sensor);
});
}
When I test is I am getting this error: Error: Object with ID 'assetID:0138' in collection with ID 'Asset:org.acme.mynetwork.Sensor' does not exist
How can I solve this?