Java Sample – for Profitability and Cost Management

Prerequisites: json.jar

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

public void runCalculation() throws Exception {
        String subsetStart = null;
        String subsetEnd = null;
        String ruleName = null;
        String ruleSetName = null;
        JSONObject json = new JSONObject();
        json.put("isClearCalculated", true);
        json.put("isExecuteCalculations", true);
        json.put("isRunNow", true);        
        json.put("comment", "Run Calculation");
        json.put("subsetStart", subsetStart);
        json.put("subsetEnd", subsetEnd);        
        json.put("ruleName", ruleName);
        json.put("ruleSetName", ruleSetName);
        json.put("exeType", "ALL_RULES");
        json.put("stringDelimiter", "_");
        String povGroupMember = "2014_January_Actual";
        String urlString = "%s/epm/rest/%s/applications/%s/povs/" + povGroupMember.trim().replaceAll(" ", "%20") 
                                       + "/jobs/runLedgerCalculationJob";
        executeJob(urlString, "POST", json.toString());