Java Sample – CreateFlatFileApplication.java for Oracle Profitability and Cost Management Cloud

Prerequisites: json.jar

Prerequisites: See Oracle Profitability and Cost Management Cloud Common Helper Functions for Java

  public void createFlatFileApplication() throws Exception {
        
        JSONObject json = new JSONObject();
        json.put("description", "Flat file based application");
        json.put("ruleDimensionName", "Rule");
        json.put("balanceDimensionName", "Balance");       
        
        String urlString = serverUrl + "/epm/rest/"+ apiVersion + "/fileApplications/" + "BksML13";
        String response = executeRequest(urlString, "POST", json.toString(), "application/json");
        
        JSONObject jsonObj = new JSONObject(response);
        int resStatus = jsonObj.getInt("status");
        
        if(resStatus == 0) {
            System.out.println("Application created successfully");
        } else {
            System.out.println("Application creation failed");
        }   
  }