Skip to content

Commit

Permalink
Allow protocol sync to rewrite paratoo internal ids #823
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Feb 6, 2024
1 parent 7cfb777 commit 0bfbcdb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grails-app/services/au/org/ala/ecodata/ParatooService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,12 @@ class ParatooService {
log.info message
}
else {
String message = "Updating form with id: "+id+", guid: "+guid+", name: "+name+", new id: "+id
ExternalId paratooInternalId = form.externalIds.find{it.idType == ExternalId.IdType.MONITOR_PROTOCOL_INTERNAL_ID}

// Paratoo internal protocol ids are not stable so if we match the guid, we may need to update
// the id as that is used in other API methods.
ExternalId paratooInternalId = form.externalIds.find{it.idType == ExternalId.IdType.MONITOR_PROTOCOL_INTERNAL_ID}
if (paratooInternalId) {
String message = "Updating form with id: "+paratooInternalId.externalId+", guid: "+guid+", name: "+name+", new id: "+id
paratooInternalId.externalId = id
}
else {
Expand Down

0 comments on commit 0bfbcdb

Please sign in to comment.