diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java index a977db9ad6..f15c336b9c 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java @@ -64,6 +64,21 @@ public class ActionsExecutionAPI extends RMModelRequest ImmutableMap.of("path", destinationPath)); } + /** + * Declares and files a document as record to a record folder using v1 actions api + * + * @param targetNode the node on which the action is executed + * @param destinationPath the path to the record folder + * @param encoded value to indicate if the path has been encoded + * @throws Exception + */ + public JSONObject declareAndFile(RepoTestModel targetNode, String destinationPath, boolean encoded) throws Exception + { + return getRmRestWrapper().withCoreAPI().usingActions() + .executeAction(ActionsOnRule.DECLARE_AS_RECORD.getActionValue(), targetNode, + ImmutableMap.of("path", destinationPath, "encoded", String.valueOf(encoded))); + } + /** * Declares a document as record using v1 actions api * diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileDocumentAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileDocumentAsRecordTests.java index db798cf113..f16ad991db 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileDocumentAsRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileDocumentAsRecordTests.java @@ -237,7 +237,7 @@ public class DeclareAndFileDocumentAsRecordTests extends BaseRMRestTest { STEP("Declare document as record with an encoded location parameter value"); getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFile(testFile, - Utility.buildPath(recordCategory.getName(), RECORD_FOLDER_NAME_ENCODED)); + Utility.buildPath(recordCategory.getName(), RECORD_FOLDER_NAME_ENCODED), true); STEP("Verify the declared record is placed in the record folder"); assertTrue(isMatchingRecordInRecordFolder(testFile, recordFolderWithSpacesInName), "Record should be filed to record folder");