In PCS, we will need to create 2 web service connectors, the first connector is for CEC folder creation using CreateMultipleFolders proxy service, and the second connector is for report generation and file upload to CEC using GenerateBIReportToDOCS proxy service.
When a PCS instance is initiated, it will create the process instance folder(s) in CEC, on some occasions, it might take a few seconds for the CEC to create the folder and be visible when you invoke the CEC REST service. Hence, we will need to put a wait activity before each service call, this is to ensure all necessary information are created and available before the next service call and the folder(s) will be created in the designated PCS instance folder in CEC.
In the CreateMultipleFolders service, the PCS instance ID will be used as an input for the create docs folder service. The following screenshot demonstrates the data input mapping for Create CEC Folder activity. For the parent folder of the subfolder(s) that you want to use, you will need to use the predefined properties called instance ID e.g. "SalaryReportProcess-1.0/SalaryReportProcess_Instance_" + instanceId + "/Application Documents".
For this demonstration, I am using a data object called report folder to store the folder name output from the OSB web service, it will be used as a destination folder in DOCS for the generated report. In this demonstration, we will use the first folder created on the list for demonstration purposes. You can do this by explicitly specifying the index number of the element array as an input data:
The following screenshot demonstrates the data input mapping to Generate and Upload Report activity. We will map the folder name using this expression: "SalaryReportProcess-1.0/SalaryReportProcess_Instance_" + instance ID + "/Application Documents/" + report folder, this will allow the OSB to upload generated PDF report to the designated report folder in DOCS and the report will be visible in the PCS Review Report human task.
You will also need to provide the BI Publisher sample report path, I am using the salary report with no parameters, for example, the report absolute path is "/Samples/1. Overview/Salary Report - No Parameters.xdo", this sample report will generate a PDF file with no parameters.
To test the PCS application, you can follow this instruction to deploy the application for testing. https://docs.oracle.com/cloud/latest/process_gs/CPRCW/GUID-82201213-DB6D-4324-9CF9-DF83138B0728.htm#CPRCW-GUID-82201213-DB6D-4324-9CF9-DF83138B0728. We will be using the workspace for testing.
After you have deployed the SalaryReport application, you will start the application using the workspace.
Enter the following data in the webform and click submit:
Requester Name: <<Your name>>
File Name: <<Your name>>_salaryreport.pdf
Folder Name: Salary Report
Folder Description: Salary Report Folder
In another browser window, login to CEC using the username and password that you have configured when you configured the PCS and CEC integration in part 1 of this blog. You will notice the process instance folder and the Salary Report folder are created. The <<Your name>>_salaryreport.pdf will be created in the Salary Report folder.
Going back to the workspace, you will see a task waiting for you. Open the task and navigate to the attachment and you will find the same PDF report in the Salary Report folder.
After you have reviewed the report, you can then click on the approve button and complete the task.
In this 3 part blog series, I have demonstrated the PCS, SOACS/OSB, CEC and BI Publisher integration using REST and SOAP.