Generate Program Documentation Report - Run as a Job

Submits a job to generate a Program Documentation report for a given Profitability and Cost Management point of view.

The report is generated in the profitoutbox folder with the name as fileName parameter value or HPCMMLProgramDocumentationReport_{AppName)_{POV}.pdf as default. The file can be downloaded using File Explorer or by using the EPM Automate downloadfile command.

Required Roles

Service Administrator, Power User, User, or Viewer

REST Resource

POST

/epm/rest/{api_version}/applications/<applicationName>/povs/<povName>/jobs/programDocReportJob

Note:

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.

Request

Supported Media Types: application/json

The following table summarizes the client request.

Table 24-23 Parameters

Name Description Type Required Default
api_version Version of the API you are developing with, such as v1 Path Yes None
applicationName Name of the application for which to create the report Path Yes None
povName The POV for which to create the report, for example, FY17_JUN_Actual_Working Path Yes None
fileType The file format to use for the report, PDF, XML, WORD, EXCEL, or HTML Request Payload No PDF
fileName Name of the output file Request Payload No HPCMMLProgramDocumentationReport_<AppName>_POV.pdf
subsetStart Rule set starting sequence number to specify a range of rule sets to include in the report Request Payload No None
subsetEnd Rule set ending sequence number to specify a range of rule sets to include in the report Request Payload No None
useAlias Boolean value to specify whether to use aliases in the report, true or false Request Payload No False
stringDelimiter POV Dimension members separator Request Payload No "_"

Example URL

https://<BASE-URL>/rest/v1/applications/<applicationName>/povs/<povName>/jobs/programDocReportJob

Request Payload

{
     "fileName":"FY12ActualReport.pdf",
     "fileType": "PDF",
     "subsetStart":"1",
     "subsetEnd":"6",
     "useAlias": false,
     "stringDelimiter":"_"
}

Response

Supported Media Types: application/json

Table 24-24 Parameters

Name Description
details Program Documentation report name, such as HPCMMLProgramDocumentationReport_BksML30_2016_January_Actual.pdf, and report status
status See Migration Status Codes
statusMessage Message about the status, such as Success
type Profitability
data Parameters as key value pairs
links Detailed information about the link
href Links to API call
action The HTTP call type
rel Relationship type
data Parameters as key value pairs passed in the request

Example of Response Body

The following shows an example of the response body in JSON format.

{
   "type":"Profitability",
   "status":-1,
   "statusMessage":"In Progress",
   "details":"Program Documentation report 2016JanActual1.pdf generated successfully in the Outbox folder.",
   "links":[
      {
         "href":"http://<BASE-URL>/epm/rest/v1/applications/jobs/ChecktaskStatusJob/BksML30_ProgramDocumentation_D20220511T115113_52a",
         "action":"GET",
         "rel":"Job Status"
      }
   ]
}

Java Sample – GeneratePrgrmDocReport.java for Profitability and Cost Management

Prerequisites: json.jar

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

public void generateProgramDocReportJob() throws Exception {  
    JSONObject json = new JSONObject();
    json.put("fileName", "2016JanActual1.pdf");
    json.put("fileType", "PDF");
    json.put("subsetStart", "1");
    json.put("subsetEnd", "6");
    json.put("useAlias", false);
    json.put("stringDelimiter", "_"); 
    String povGroupMember = "2016_January_Actual";   
    String urlString = serverUrl + "/epm/rest/"+ apiVersion + 
      "/applications/" + applicationName + "/povs/" + 
      povGroupMember.trim().replaceAll(" ", "%20") +
      "/jobs/programDocReportJob";  
    executeJob(urlString, "POST", json.toString());         
} 

cURL Sample – GeneratePrgDocReport.sh for Profitability and Cost Management

Common Functions: See Profitability and Cost Management Common Helper Functions for cURL.

funcProgramDocReportJob() {
	url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/povs/$POV_GROUP_MEMBER1/jobs/programDocReportJob
        stringDelimter="_";
        param="{\"fileName\":\"2016JanActual.pdf\",\"fileType\":\"PDF\",\"subsetStart\":\"1\",\"subsetEnd\":\"6\",
\"useAlias\":\"false\",\"stringDelimter\":\"$stringDelimiter\"}"
        
        echo $param
	funcExecuteRequest "POST" $url $param "application/json"

	output=`cat response.txt`
	status=`echo $output | jq '.status'`
    if [ $status == -1 ]; then
        echo "Started program doc report generation"
		funcGetStatus "GET"
    else
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
    fi
	funcRemoveTempFiles "respHeader.txt" "response.txt"
}

Groovy Sample – GeneratePrgrmDocReport.groovy for Profitability and Cost Management

Prerequisites: json.jar

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

def generateProgramDocReportJob() {
    JSONObject json = new JSONObject();
    json.put("fileName", "2016JanActual");
    json.put("fileType", "PDF");
    json.put("subsetStart", "1");
    json.put("subsetEnd", "6");
    json.put("useAlias", false);
    json.put("stringDelimter", "_");
    String urlString = serverUrl + "/epm/rest/"+ apiVersion +
        "/applications/" + appName + "/povs/" + 
        povGroupMember.trim().replaceAll(" ", "%20") +
        "/jobs/programDocReportJob";
    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());
}