In PCS, we will need to create 2 web service connectors, the first connector is for DOCS folder creation using CreateMultipleFolders proxy service, and the second connector is for report generation and file upload to DOCS using GenerateBIReportToDOCS proxy service.
When a PCS instance is initiated, it will create the process instance folder(s) in DOCS, in some occasion, it might take a few seconds for the DOCS to create the folder and be visible when you invoke the DOCS 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 DOCS.
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 DOCS Folder activity. For the parent folder of the sub folder(s) that you want to use, you will need to use the predefined properties called instanceid, e.g. “SalaryReportProcess-1.0/SalaryReportProcess_Instance_” + instanceId + “/Application Documents”.
For this demonstration, I am using a data object called reportFolde 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 in the list for demonstration purpose. 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 for Generate and Upload Report activity. We will map the foldername using this expression: “SalaryReportProcess-1.0/SalaryReportProcess_Instance_” + instanceId + “/Application Documents/” + reportFolder, 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.
Test and Verify
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 DOCS using the username and password that you have configured when you configured the PCS and DOCS integration in part 1 of this blog. You will notice the process instance folder and 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 review 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, DOCS and BI Publisher integration using REST and SOAP.
All site content is the property of Oracle Corp. Redistribution not allowed without written permission