Oracle BI EE 10.1.3.3/2 – Blocking Answers Requests

One other least explored/talked about feature of BI EE is the Blocking Requests feature. One can have customized pop up messages prompting users to enter valid data. For example, as administrators we might know that certain columns once pulled into the report will consume huge amounts of memory since a grouping on them is a costly operation. In such a case, we can have a customized pop up message(like “Apply filter on this column”) that would get displayed to those end users who are pulling that particular column into the report. Also, the users would not be able to create the report unless they apply some filter on that particular column. Lets see how to go about creating such kind of blocking requests.
1. Go to {OracleBI}\web\msgdb\messages. Open the file answerstemplates.xml in notepad. Search for the function validateAnalysisCriteria. This is the function which we are going to override using a custom function. To override we would be following the same method about which we saw earlier here.
2. Go to {OracleBI}\web\msgdb\customMessages. Create a file called QueryBlock.xml. The content of the file will be the following
<?xml version=”1.0″ encoding=”utf-8″?>
<WebMessageTables xmlns:sawm=”com.siebel.analytics.web.messageSystem”>
<WebMessageTable system=”QueryBlocking” table=”Messages”>
<WebMessage name=”kuiCriteriaBlockingScript” translate=”no”>
<HTML>
<script language=”javascript” src=”fmap:myblocking.js” mce_src=”fmap:myblocking.js” />
</HTML>
</WebMessage>
</WebMessageTable>
</WebMessageTables>
As you see above, the QueryBlock.xml overrides the kuiCriteriaBlockingScript. By default there are no scripts that would be called. Here we are making the function to call “myblocking.js” script.
3. Open a textpad/notepad and enter the following content and save it as myblocking.js in any folder.
function validateAnalysisCriteria(analysisXml)
{
// Create the helper object
var tValidator = new CriteriaValidator(analysisXml);
// Validation Logic
if (!tValidator.filterExists(“Sales Measures”,”Dollars”))
return “Why don’t you filter on Dollars?”;
return true;
}
I am using the blocking script available in the documentation. What this script basically does is that, it looks out for a filter on “Sales Measures”.”Dollars”. If it exists only then the function will succeed.
4. Copy the myblocking.js script to 2 folders. {OracleBI}/web/app/res/b_mozilla and {OracleBI}/oc4j_bi/j2ee/home/applications/analytics/analytics/res/b_mozilla
5. Restart BI Server and OC4J.
6. Now lets try creating a sample report without the filter first(include the dollars measure of the paint subject area). Click on display results.
                    
We will get the message which we have put in the myblocking.js since we have not included any filter.
7. Now lets try applying a sample filter on dollars.