diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/CompleteRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/CompleteRecordTests.java index 23a81fce5b..f683dcf6fa 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/CompleteRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/CompleteRecordTests.java @@ -35,13 +35,7 @@ import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY; import static org.testng.Assert.assertEquals; -import javax.xml.namespace.QName; -import java.io.Serializable; import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; import org.alfresco.rest.rm.community.base.BaseRMRestTest; import org.alfresco.rest.rm.community.model.record.Record; @@ -153,7 +147,7 @@ public class CompleteRecordTests extends BaseRMRestTest } /** - * Incomplete records with mandatory meta-data missing + * Record to be completed is frozen */ @DataProvider (name = "FrozenRecords") public Object[][] getFrozenRecords() throws Exception @@ -330,6 +324,7 @@ public class CompleteRecordTests extends BaseRMRestTest private void createMandatoryMetadata() { + } private void setMandatoryMetadata(Record record) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/records/RecordsEntityResource.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/records/RecordsEntityResource.java index 6ce1ff28d6..6c437b3951 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/records/RecordsEntityResource.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/records/RecordsEntityResource.java @@ -283,7 +283,7 @@ public class RecordsEntityResource implements BinaryResourceAction.Read, } else { - throw new IntegrityException("Model integrity exception: the record is already completed.", null); + throw new IntegrityException("Model integrity exception: the record is frozen or already completed.", null); } // return record state diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index a9a7e3f9a7..1c80b65973 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -1799,6 +1799,47 @@ paths: description: Unexpected error schema: $ref: '#/definitions/Error' + '/records/{recordId}/complete': + post: + tags: + - records + summary: Complete a record + description: | + Completes the record **recordId**. + operationId: completeRecord + parameters: + - $ref: '#/parameters/recordIdParam' + - $ref: '#/parameters/recordEntryIncludeParam' + - $ref: '#/parameters/fieldsParam' + consumes: + - application/json + produces: + - application/json + responses: + '200': + description: Successful response + schema: + $ref: '#/definitions/RecordEntry' + '400': + description: | + Invalid parameter: **recordIdParam** is not a valid format or + **recordIdParam** is not a record + '401': + description: Authentication failed + '403': + description: >- + Current user does not have permission to complete record + **recordIdParam** + '404': + description: | + **recordIdParam** does not exist + '422': + description: | + Model integrity exception: the record is frozen or already completed + default: + description: Unexpected error + schema: + $ref: '#/definitions/Error' ## Files '/files/{fileId}/declare': post: