on 10-08-2009 5:51 AM
Hi,
How to update the tuple data in MDM? can anybody help me to do this.
regards,
Ushasree P
hi Sree,
Try to do following
TupleValue tupleValue = null;
String tupleRecordId = null;
//Get the tuple recordId which you want to modify
if(tupleRecordId!=null){
tupleValue = MdmValueFactory.createTupleValue(new TupleRecordId(tupleRecordId));
}
//Set the values For this tuple and excute ModifyRecordCommand.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
TupleValue tvPhoneNumber ;
FieldId fiPhoneNumber;
MdmValue mvPhoneNumber = new StringValue(u201C1231231231u201D) ;
tvPhoneNumber.setFieldValue( fiPhoneNumber , mvPhoneNumber ) ;
//set the tuple value to the field id of the record using the record.setFieldValue( id, value ) ;
Assuming you have a multi tuple value, then you would need one more step.
//get the field value of the multi tuple value from record and get the tuple value on an index.
MultiTupleValue mtvAddress ;
FieldId fiPhoneNumber;
TupleValue tvPhoneNumber = mtvAddress.getValue(int index) ;
MdmValue mvPhoneNumber = new StringValue(u201C1231231231u201D) ;
tvPhoneNumber.setFieldValue( fiPhoneNumber , mvPhoneNumber ) ;
mtvAddress.modifyTupleValue( tvPhoneNumber);
//set the multi tuple value to the field id of the record using the record.setFieldValue( id, value ) ;
After doing either of the above steps you will have to run a modify records command on the main record.
I am submitting one document on deleting updating MDM records and should be published soon.
Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ushasree,
Tuple record can be updated by following the below steps in sequence :
1) Create an instance of tuple value : MdmValueFactory.createTupleValue(tupleRecordId)
2) Retrieve existing Tuple value -
To retrieve the TupleValue/MultiTupleValue interfaces, use one of the following two methods:
a) Record.getFieldValue(tupleFieldId)
If the tuple record is part of the original table record that can be obtained using one of the Retrieve commands responsible for retrieving records.
b) TupleValue.getFieldValue(tupleFieldId)
If the tuple record is part of another tuple record (nested tuple structure)
3) Modify a tuple value using - TupleValue.setFieldValue(tupleFieldId, tupleValue
4) Set modified Tuple Value to an instance of a Record such as: Record.setFieldValue(tupleFieldId, tupleValue)
5) Execute ModifyRecordCommand with the prepared Tuple Value as input parameter.
Hope this helps.
Regards,
Vinay M.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.