Reference Records data field, access from OWS REST API
Accessing reference records data field from OWS code is always a myth, but now at 9th version of trackwise which supports rest API, Its enable access and manipulation of reference records.
fieldMap = Util.toFieldMap(pr);
ReferenceRecordDataField dataField = (ReferenceRecordDataField) fieldMap.get("referenceRecordFieldName");
List<ReferenceRecordDetails> d = dataField.getValue();
for(ReferenceRecordDetails obj : d){
System.out.println("-PR ID->"+obj.getPrId());
System.out.println("-Seq No->"+obj.getSeqNo());
}
ReferenceRecordDetails object = new ReferenceRecordDetails();
object.setPrId(1001);
object.setSeqNo(3);
d.add(object);
dataField.setValue(d);
//save the changes to the PR
savePr(resource,mapper,pr);
In this above code reference record data field class has been exposed by this new version of trackwise, where REST API provides us the capability to access contents of reference data field.