Fixing errors in Calc Manager 11.1.2.3.502 Custom Defined Functions

**** Please see the edit at the bottom of this post for important information ****

Celvin Kattookaran and Cameron Lackpour have previously blogged about the Calc Manager 11.1.2.3.502 CDFs.  Celvin does a great job in both the ODTUG Blog “Tech Tips” article and his blog where he describes the use of some of these functions.  As I was researching these functions, I found several errors in my Essbase application logs where five of these functions are not registered properly.

[Wed Jan 07 11:46:43 2015]Local/Vis_ASO///13072/Warning(1200490)
Wrong java method specification [com.hyperion.calcmgr.common.cdf.exportData(String,String,String,String,String,String,String,String,String,String,String,String,String,String,String)] (function [@CalcMgrMDXExport]): [specified class not found:com.hyperion.calcmgr.common.cdf]

[Wed Jan 07 11:46:43 2015]Local/Vis_ASO///13072/Warning(1200490)
Wrong java method specification [com.hyperion.calcmgr.common.cdf.StringFunctions.substring2(String,int,int)] (function [@CalcMgrSubstring]): [specified method not found:com.hyperion.calcmgr.common.cdf.StringFunctions::substring2(java.lang.String,int,int)]

[Wed Jan 07 11:46:43 2015]Local/Vis_ASO///13072/Warning(1200490)
Wrong java method specification [com.hyperion.calcmgr.common.cdf.StringFunctions.indexOf(String,int)] (function [@CalcMgrIndexOf]): [specified method not found:com.hyperion.calcmgr.common.cdf.StringFunctions::indexOf(java.lang.String,int)]

[Wed Jan 07 11:46:43 2015]Local/Vis_ASO///13072/Warning(1200490)
Wrong java method specification [com.hyperion.calcmgr.common.cdf.StringFunctions.lastIndexOf(String,int)] (function [@CalcMgrLastIndexOf]): [specified method not found:com.hyperion.calcmgr.common.cdf.StringFunctions::lastIndexOf(java.lang.String,int)]

[Wed Jan 07 11:46:43 2015]Local/Vis_ASO///13072/Warning(1200490)
Wrong java method specification [com.hyperion.calcmgr.common.cdf.CalendarFunctions.getCurrentDate(int)] (function [@CalcMgrGetCurrentDate]): [specified method not found:com.hyperion.calcmgr.common.cdf.CalendarFunctions::getCurrentDate(int)]

@CalcMgrGetCurrentDate

So, how do we fix these?  Celvin comes to the rescue on the first one.  In his Tech Tips article, he explains that we need to remove the “int” input parameter in the Java Method field.

  1. In EAS, I right-clicked on my Essbase server and selected Edit>Functions.
  2. Inside the CDF Manager, I selected the @CalcMgrGetCurrentDate function and clicked the Edit button.
  3. Inside the Edit Function window, we change the Java Method field from getCurrentDate(int) to getCurrentDate().
  4. Stop/Restart an application and view the log to verify that the function is registered properly.

That works great and it’s one down, four to go.

Change getCurrentDate(int) to getCurrentDate()

Change getCurrentDate(int) to getCurrentDate()

@CalcMgrIndexOf and @CalcMgrLastIndexOf

Next we can fix @CalcMgrIndexOf and @CalcMgrLastIndexOf with the same steps.  These functions are not declared properly.  I took at peek into the Java class for these functions and found that they need to receive two String variables and a numeric variable.  The default specification is one String and one number.  To fix these two functions, we need to add an additional String to the input parameters in the Java Method field.  Change indexOf(String,int) to indexOf(String,String,int). Next we need to edit the Spec field to add “searchString”.  Change @CalcMgrIndexOf(text, beginIndex) to @CalcMgrIndexOf(text, searchString, beginIndex).

Change indexOf(String,int) to indexOf(String,String,int) and @CalcMgrIndexOf(text, beginIndex) to @CalcMgrIndexOf(text, searchString, beginIndex)

Change indexOf(String,int) to indexOf(String,String,int) and @CalcMgrIndexOf(text, beginIndex) to @CalcMgrIndexOf(text, searchString, beginIndex)

@CalcMgrSusbtring

With the @CalcMgrSusbtring function, we need to edit the Java Method and Spec fields to remove the “2”.  Change substring2(String,int,int) to substring(String,int,int), then change @CalcMgrSubstring2(text, startIndex, endIndex) to @CalcMgrSubstring(text, startIndex, endIndex).  If you use EAS to edit this function, you will run into an error when trying to save the change back.  The error looks something like this:

The Comment field is over 256 characters.

The Comment field is over 256 characters.

Great, now what?  Well, we can edit the comment field and remove the third line and that would allow us to save the function back since we would have reduced the comment field to under 256 characters.  More on that later… Until then, this is what your function should look like when it’s fixed.

Fixed @CalcMgrSubstring function definition.

Fixed @CalcMgrSubstring function definition.

@CalcMgrMDXExport

The final function is @CalcMgrMDXExport.  Celvin has a great explanation of how this works and shows a great example on this blog, so read that to see how cool this is.  This function is missing the Class in its Java Class field.  To fix this one add “.MDXExport”.  We need to change com.hyperion.calcmgr.common.cdf to com.hyperion.calcmgr.common.cdf.MDXExport.

That’s pretty simple, but we are again going to run into issues with EAS CDF Manager.  As we previously found out, the Comment field has a limit of 256 characters in EAS.  If you cut down the comment on this function, you’ll also find out that the Spec field has a limit and of course this function is too large.  Through testing, I found the limit of the Spec field is 128 characters.  The default Spec for this function is 162 characters.  We could use shorthand changing “application” to “app” and “database” to “db”, but that’s really a pain.  If only there was a way to edit these functions without losing the comments and extended specification.

Essfunc.xml

This is where Cameron’s blog comes in.  Cameron has covered the Planning CDF functions in the past and explained that the “essfunc.xml” holds a better explanation of the @Hsp* Planning functions.  Well, that’s also the file that EAS looks at when you Open the CDF Manager, only in a different location.  So, if you make these same changes to the function specification in the proper essfunc.xml file, the functions will be fixed in EAS and you can then call them like a calculator function.

The essfunc.xml that contains the definitions of my server-wide CDFs, that is the functions that are valid for all applications, is stored in C:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\java. As I have previously blogged, I prefer TextPad for my text editing duties, so that is the tool I used for editing.

In my copy of essfunc.xml, on line 82 the function for @CalcMgrMDXExport starts:

<function name=”@CalcMgrMDXExport” tssec=”1420730410″ tsmcs=”606000″ javaSpec=”com.hyperion.calcmgr.common.cdf.exportData(String,String,String,String,String,String,String,String,String,String,String,String,String,String,String)”>

To fix this one, all we need to do is edit that one line to:

<function name=”@CalcMgrMDXExport” tssec=”1420730410″ tsmcs=”606000″ javaSpec=”com.hyperion.calcmgr.common.cdf.MDXExport.exportData(String,String,String,String,String,String,String,String,String,String,String,String,String,String,String)”>

Just inserting “.MDXExport” in the javaSpec is all we need to do.  No messing around with shorting the Comment or Spec fields needed.  Save the file back to the server.  To verify the change was made, we can view the function in the EAS CDF Manager where we should see our edits have saved properly.  Stop and restart your application to verify that the edits were successful and that the function has registered properly.

1-4-2015 5-04-55 PM

The five specification errors fixed and ready to be used.

 

****EDIT 6/11/2015 **** Calculation Manager 11.1.2.3.505 fixes these errors, so just apply PSU 20968612 and you won’t need to mess with fixing the CDF registration in EAS or the essfunc.xml.

Advertisements

3 comments

  1. Pingback: Essbase Down Under

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s