I am trying to change the value of the Participant using a transaction. It throws the error "Error: Object with ID 'Participant:com.test.participant' in collection with ID '$sysregistries' does not exist"
Please let me know what is the issue. Was there any change in the new version ??
Base cto :
namespace com.test.base
enum Gender {
o MALE
o FEMALE
o OTHER
}
/**
* A concept for a simple street address
*/
concept Address {
o String address
o Boolean isAddressValidated
}
Participant CTO :
/**
* New model file
*/
namespace com.test.participant
import com.test.base.*
abstract participant User{
o String lastname
}
participant Customer identified by userId extends User {
o String userId
o String fName
o Address address
}
transaction ValidateAddress {
o Boolean isAddressValidated
--> Customer customer
}
Js file:
/**
* Sample transaction processor function.
* @param {com.test.participant.ValidateAddress} tx The sample transaction instance.
* @transaction
*/
async function sampleTransaction(tx) {
tx.customer.address.isAddressValidated = tx.isAddressValidated;
const participantRegistry = await getParticipantRegistry('com.test.participant','Costumer');
await participantRegistry.update(tx.customer);
}
Test values:
{
"$class": "com.test.participant.Customer",
"uId": "customer1",
"fName": "Pradeep",
"address": {
"$class": "com.test.base.Address",
"address": "",
"isAddressValidated": false
},
"lastname": "P"
}
{
"$class": "com.test.participant.ValidateAddress",
"isAddressValidated": true,
"customer": "resource:com.test.participant.Customer#customer1"
}
Download bna file as well in the link https://drive.google.com/file/d/1NQYELmLzMyuN2V4yvDhUoLWackjs18Fa/view?usp=sharing