Groovy Sample – UpdateDimensionJob.groovy for Oracle Profitability and Cost Management Cloud

Prerequisites: json.jar

Common functions: See Appendix C: Common Helper Functions for Groovy.

def updateDimensionsJob() {
        
        JSONObject json = new JSONObject();
        json.put("dataFileName", "Accounts.txt,Activity.txt");
        
        String urlString = serverUrl + "/epm/rest/"+ apiVersion + "/fileApplications/"+ appName + "/updateDimensionJob";
        def url;
        
        try {
                url = new URL(urlString)
        } catch (MalformedURLException e) {
                println "Malformed URL. Please pass valid URL"
                System.exit(0);
        }
        
        executeJob(url,"POST",json.toString()); 
    }

Note:

In the main method, add the following statement:

restSamplesObj.updateDimensionJob();