Deltek Cobra has the capability to connect to an Oracle Primavera P6 database and bring data into Deltek Cobra. It uses an ODBC connection to retrieve data that is stored in the Primavera P6 database. But, it needs to use the Primavera P6 API to extract time phased data used for budgets as this is calculated on the fly and not stored in the P6 database. Most users find the ODBC connection relatively easy to setup, but problems can exist with setting up the Primavera P6 API.
One frequent request is to hook up a version of the Primavera P6 API that doesn’t come as standard with Deltek Cobra. This article explains how Deltek Cobra uses the P6 API and how it calls it. Knowing this information will allow you to add almost any version of Oracle Primavera P6 to Deltek Cobra 5.1.x and get it working.
What does the Primavera P6 API integration do?
The Oracle Primavera P6 API is written in Java and Deltek has written a small Java application that it runs to extract the data it needs and store it in a CSV file containing six fields representing one day for each resource assignment. The first four of which are:
- P6 Internal Resource Assignment Id
- Date
- Remaining Units
- Remaining Cost
The last two fields are At Complete Units and At Complete Costs when Schedule Dates have been chosen and Planned Units and Planned Costs when Baseline Dates have been chosen. Once the small java application has created the CSV file, Deltek Cobra uses it to update the spread held in the Cobra project.
How does Deltek Cobra connect to Primavera P6 API?
Applications that wish to connect to an Oracle P6 database need to know where a file called BREBootStrap.xml is located and where all the P6 API library files can be found. A standard installation of the P6 API will place the BREBootStrap.xml file in the root directory of the P6 API and the jar library files in a subdirectory called lib.
This is exactly what Deltek Cobra is expecting, and if your P6 API isn’t installed like this then it won’t work with Deltek Cobra. The Integration Wizard in Cobra is used to specify where the P6 API has been installed and therefore where the BREBootStrap.xml file and jar library files are located. The location of the BREBootstrap.xml file and jar library files need to be passed to the Java application as command line parameter which Deltek Cobra does when calling the application.
The BREBootStrap.xml is passed using a -D switch such as -Dprimavera.bootstrap.home=c:\oracle\p6\api. The jar library files are a slightly different story as each one has to be listed and each version of the P6 API can have a different set of jar files.
Deltek Cobra looks up the list of jar library files it needs to pass in the P3eAPIClasses.xml file which is stored in the Cobra P3eAPI directory.The following is an example output from this file showing the first three entries for my version of Deltek Cobra.
Each version of the P6 API has an entry in a <ClassPath> tag and the Version attribute in that tag is used to determine which <ClassPath> tag to use. That version number is not obvious and my xml file comes with versions 15.100, 8.400, 8.309, 8.301, 8.120, 8.1, 7.0, 6.2, 6.1, 6.0 and 5.0. This version name has to match the <CfgVersion> tag from the BREBootStrap.xml file.
How to hook up another Primavera P6 version
I am using Deltek Cobra with Oracle Primavera P6 v15.2, which is not listed in the P3eAPIClasses.xml file provided by Deltek, because the P6 version was released after the Cobra version. As mentioned earlier, the P6 API has been installed into its own directory under C:\oracle\p6\api and verified it is working according to the Oracle P6 documentation.
The first step is to open up the BREBootStrap.xml file and make a note of the <CfgVersion>, which is 15.200 as seen in the following listing:
The next step is to open the lib directory and make a note of all the jar files it contains.
The final step is to add a <ClassPath> entry into the P3eAPIClasses.xml file. The Version attribute is set to “15.200” and all the jar files are listed preceded by %INTG_HOME%/. Deltek Cobra will substitute the %INTG_HOME% variable with the provided Primavera API Location, which in my case is C:\oracle\p6\api.