Monday, December 12, 2011

PLSQL block for Publication process

If there is any issue entering parameters for Concurrent program or if you want to automate your publishing process, go for following plsql block:

DECLARE
  P_API_VERSION NUMBER;
  P_PUBLICATION_ID NUMBER;
  P_USER_ID NUMBER;
  P_RESP_ID NUMBER;
  P_APPL_ID NUMBER;
  X_RUN_ID NUMBER;
  X_STATUS NUMBER;
BEGIN
  P_API_VERSION := 1.0;
  P_PUBLICATION_ID := 64689;
  P_USER_ID := 1001530;  --EBUSINESS
  P_RESP_ID := 22687;  --Oracle Configurator Administrator
  P_APPL_ID := 708; --Configurator

  CZ_MODELOPERATIONS_PUB.PUBLISH_MODEL(
    P_API_VERSION => P_API_VERSION,
    P_PUBLICATION_ID => P_PUBLICATION_ID,
    P_USER_ID => P_USER_ID,
    P_RESP_ID => P_RESP_ID,
    P_APPL_ID => P_APPL_ID,
    X_RUN_ID => X_RUN_ID,
    X_STATUS => X_STATUS
  );
  DBMS_OUTPUT.PUT_LINE('X_RUN_ID = ' || X_RUN_ID);
  DBMS_OUTPUT.PUT_LINE('X_STATUS = ' || X_STATUS);
END;

Ensure you enable dbms output to check the return status.
Successful submission would return 0 as x_status.
You can also check in Configurator Developer  >  Publication tab for this publication, it should show as Complete.

P.S. All Configurator process APIs are listed in Implementation Guide of Configurator.
Change user_id, resp_id, appl_id as per your requirement.
For errors, refer cz_db_logs table.

Tuesday, December 6, 2011

Query to extract Oracle Configurator CX rule information


We can use following query to find out all the CX rules in the Configurator model. The query will display the information for the rules like rule_name, java class associated with it, event name, event scope, and oncommand event name.

SELECT DISTINCT RU.RULE_ID, 
  RU.NAME, 
  (SELECT NAME FROM CZ_SIGNATURES WHERE SIGNATURE_ID=EN.ARGUMENT_SIGNATURE_ID) AS EVENTNAME, 
  CLASS_NAME, 
  DECODE(EN.EVENT_EXECUTION_SCOPE, 1, 'Global', 2, 'Base Node SubTree', 4, 'Base Node', 'Unknown') AS SCOPE, 
  EN.DATA_VALUE oncommandEventName
FROM CZ_RULES RU, 
  CZ_EXPRESSION_NODES EN
WHERE DEVL_PROJECT_ID IN (131343) --for given devl_project_id
  AND RU.RULE_ID=EN.RULE_ID
  AND RU.RULE_TYPE=300 --for CX rules
  AND EN.ARGUMENT_SIGNATURE_ID IS NOT NULL --with valid event
  AND RU.DELETED_FLAG=0 --ignore deleted nodes
  AND EN.DELETED_FLAG=0
  AND EN.EXPR_PARENT_ID IS NULL --definition is only on parent node of expression tree
;

This query is useful at times to find out all CX rules with base node subtree event scope which may usually cause performance issue if its unwanted. You can always add other parameters/clauses to filter information as per your need.

Sunday, November 20, 2011

Oracle apps R12 - Compiling JSP with custom classpath

We all know that to compile JSP manually on the Oracle Application R12 instance, we need to run the file $FND_TOP/patch/115/bin/ojspCompile.pl.

Its help is as follows:

syntax: ./ojspCompile.pl COMMAND {ARGS}
COMMAND --compile               update dependency, compile delta
        --create                rebuild entire dependency file
        -delta.out       update dependency, list delta to file
        -dep.out      update dependency, output heirarchy to file

ARGS    -s      matching condition for JSPs filenames
        -p      number of parallel compilations
        -log     to override logfile from ojspCompile.conf
You are
recommended to set the log file location
 outside of any network file system shared (NFS) area/drive.
        -conf    to override ojspCompile.conf
        --retry         retry previously failed compilation attempts
        --flush         forces recompilation of all parent JSPs
        --quiet         do not provide an actively running progress meter
        --fast          instantly fail jsps that are *possibly* invalid

example1: ojspCompile.pl --compile -s 'jtf%' -p 20 --retry
example2: ojspCompile.pl --compile -s 'jtflogin.jsp,jtfavald.jsp' --flush
example3: ojspCompile.pl --compile --fast --quiet

If your JSP uses custom classes, then compiling jsp manually can fail if proper classpath is not set. Yes, even though if you have setup the classpath correctly in orion-application.xml, it will fail because this jsp compile utility does not read orion-application.xml classpath.

So, the problem is to identify where to set the classpath so that above utility can pick it up. After several search and looking into code, I found following:

By default, the jsp compiler script uses following configuration file
$INST_TOP/appl/admin/ojspCompile.conf
This conf file has a classpath field in it which is usually pointed to file
$INST_TOP/appl/admin/ojspCompile.properties
This property file lists the classpath used for JSP compilation.

So if your classes are not listed in this file, your jsps will not compile by ojspCompile.

Ofcourse, you can always set the "main_mode" to "recompile" in orion-web.xml, but that for production you do not want to change it and compile the JSP on file deployment.

References:

  1. 458338.1  How to Enable Automatic Compilation of JSP pages in R12 Environment
  2. 433386.1  JSP Pages Hanging in R12 After Removing Cached Class Files in _pages
  3. 783094.1  Compile jsp files at Application R12 at Windows

Wednesday, November 2, 2011

OC4j Configuration


Oracle application R12 release uses OC4J and during implementation, many would need to modify oc4j configuration for easier/faster development.

I found following links to be useful while changing OC4J configuration for development mode.

OC4J Web Application Redeployment and Class Reloading Features

Element Descriptions for global-web-application.xml and orion-web.xml

Key OC4J Flags for Development