I’d like to introduce the forthcoming availability of a new open source project called PBJ (or PB&J if you want): A Java client for PBCS (Planning and Budgeting Cloud Service) that serves as a clean, robust, and rapid way to work with the PBCS REST API in Java.
The PBCS REST API provides similar functionality to the EPM Automate tool and can perform such actions as exporting data, adding members to an outline, running business rules, and more. The REST API is an exciting development as Planning continues its march to the cloud, because it will allow integration from many languages and tools.
Consuming a REST API isn’t necessarily hard, but there are a lot of moving parts – connecting, managing credentials, invoking the right method, parsing the output, and then deciding what to do with it. Most of this is pretty boilerplate code that can get verbose pretty quickly.
Therefore, I thought it would be nice if there were a high-quality library that could easily be used and reused. This is where the PBCS Java Client – PBJ – comes in: it is a freely available library that is released under the Apache Software License. The ASL is a very generous license that essentially means you can do anything you want with the code. My hope is that this library becomes the de facto client for using Java to work with the PBCS API.
As an example of how PBJ makes things simple, consider the following example of connecting to a server and running a business rule:
<br /> PbcsClient client = new PbcsClientImpl(server, identityDomain, username, password);<br /> PbcsApplication app = client.getApplication("Vision");<br /> app.launchBusinessRule("AggAll");<br />
Here’s a small example of checking the status of a job:
<br /> PbcsClient client = new PbcsClientImpl(server, identityDomain, username, password);<br /> PbcsApplication app = client.getApplication(appName);<br /> PbcsJobStatus jobStatus = app.getJobStatus(558);<br /> System.out.println("Job status: " + jobStatus);<br />
Three lines of code and we have connected to our PBCS server, grabbed a particular application, and then invoked a business rule on it. At the moment the API supports running business rules, exporting data, refreshing cubes, downloading files, and more.
PBJ is under active development and will be released in the near future. Contributions from others are entirely welcome. Not every PBCS feature will be supported on day one. Please let me know if you’d like to contribute to or test out the API.