private JSONObject saveOrUpdate(
     DDLRecordService recordService,
     Record record,
     long groupId,
     JSONObjectWrapper serviceContextWrapper,
     JSONObject jsonContent)
     throws Exception {
   if (record.getRecordId() == 0) {
     return recordService.addRecord(
         groupId, record.getRecordSetId(), 0, jsonContent, serviceContextWrapper);
   } else {
     return recordService.updateRecord(
         record.getRecordId(), 0, jsonContent, true, serviceContextWrapper);
   }
 }