Wednesday, February 29, 2012

Using Oracle Crystal Ball API in your windows applications

[We are moving away from the API solution mentioned in this blog post because of various reasons. This blog post is available for historical reasons, but the API solution mentioned in this post is not available for either sales or support. We might still be able to help you in your desktop application by using Excel as the intermediary. If you want a discussion on that front, please feel free to post your questions in our Support channels (LinkedIn or CBUG).]

In this post, I wanted to mention an often overlooked gem in the Oracle Crystal Ball suite: the Open Crystal Ball API, or OCB API in short. If you are a Crystal Ball customer (i.e., running Crystal Ball on your desktop with Excel), then you can use the OCB API in your own applications.

OCB API is at the core of the magic that happens when you run Crystal Ball to simulate, optimize or forecast. Excel is but one of the front ends for this API (albeit, a very powerful one), but you can go far beyond what you can do within the Excel environment. Using the OCB API, you can directly access all the mathematics and analytics in your own application, in the way you want it.

OCB API is developed in C#, which is a Microsoft .NET language. That means - you are limited to using C# or other .NET languages for developing with the OCB API. Depending on your perspective, that may or may not be limiting. For example, you can use newer .NET languages with OCB API, e.g., F# or IronPython. Crystal Ball with Python - how cool is that?

Development platform and requirements
Although using OCB API does not require Excel, the OS requirements are the same as desktop Crystal Ball. Also, OCB assemblies (DLL’s) are built as platform agnostic, meaning that they can execute as part of either a 32-bit or 64-bit application.

One would presumably use Visual Studio for developing applications using OCB API, but one of the free/open source editors, like SharpDevelop and MonoDevelop, can also be used. Currently, the minimum requirement for using our API is .NET2.0 - which means you have to use at least Visual Studio 2008 to develop apps using the OCB API. Other later versions of .NET and Visual Studio are all supported.

We have never tried compiling OCB API with Mono library, but applications cannot possibly be developed with Mono and ported on Unix variants or Mac. If anyone wants to test this further, let me know.

If you have an Oracle Crystal Ball desktop license, you are also licensed to use the OCB API, there is no extra charge. You can use the same username and serial number in your code for licensing purposes. Note that, if you want to run a simulation using OCB API, you will have to provide a valid licensing code.

Availability and miscellaneous items
As mentioned, the API is available to use with a valid Crystal Ball desktop license. You have to reference the DLL’s in the installation folder in order to develop using OCB API. You can also contact sales and directly purchase a license for OCB API only.

The OCB API does not include charting. The amazing charts in Crystal Ball are generated using ChartFX library, available from SoftwareFX. They have a free lite version, which you can use for your charting needs. .NET4.0 includes charting APIs, which can also be used for generating charts.

Additionally, The OCB API does not include access to OptQuest libraries for optimization, due to licensing restrictions. The time-series forecasting part is included, however, in another DLL.

The core OCB API DLL’s are obfuscated to protect our intellectual property.

Our OCB API is well documented, and comes with a large set of sample codes to get you started. We have examples for both simulation and time series forecasting. The documentation does not get installed automatically though. Please contact an Oracle Crystal Ball sales representative to get access to the documentation.

The support process is same as desktop Crystal Ball, i.e., through Oracle Tech Support; however, this is for issues found in the OCB API, not for assistance in developing your application. We work with integration partners, who can help develop and deploy custom applications using OCB API. Other community support channels like CBUG or LinkedIn can also be used to ask questions.

Use Cases
Why might you want to use OCB API’s? Here are a few reasons.
  • If you have existing custom applications, you can use OCB API to enhance the analytics in the application, without re-building the model in Excel.
  • You can overcome some of the limitations of Excel by writing custom applications directly using OCB API:
    • Data volume/transfer
    • Modeling complex business rules or workflow
    • Model security/distribution
    • Automation
  • If you want to generate charts specific to your industry, that are not provided by Crystal Ball, or cannot be generated easily in Excel, then you can use the API along with other charting libraries.
  • Although, our Excel add-in code has really good performance, if you want to squeeze out even more performance for large datasets, you can skip the Excel overhead and directly use the OCB API on your data. Writing a .NET app with OCB API will also enable you to take advantage of the Task Parallel Library (TPL) to utilize multiple cores in modern machines. TPL is available as an extension with .NET 3.5, and as part of .NET4.0 and above.
  • If your data is not in Excel and resides in some other system (like external database etc.), then directly connecting to the data source using .NET and using the OCB API to run simulations or time-series forecasting would be easier. Alternative is to get the data in Excel using ODBC or other importing techniques.
  • Using OCB API, you can also expose simulation methods to a web service. Please contact an Oracle Crystal Ball sales representative before taking this route, since there might be additional license implications here.
Update (06/19/2013): Announcing the unavailability of API solution.

    No comments:

    Post a Comment