Saturday, November 30, 2013

Update Java Extension ClassName for Configurator CX rules using query

Following query will update the java classname (from xxcz.cx.MyOldClass to xxcz.cx.MyNewClass ) for all the models which are under repository folder name 'Models - In Process'

UPDATE cz_rules ru
SET ru.class_name        = 'xxcz.cx.MyNewClass'
WHERE exists(SELECT
  rpf.name folder_name,
  p.name model_name,
  p.devl_project_id,
  r.name rule_name,
  r.rule_id,
  r.class_name
FROM cz_rules r,
  cz_devl_projects p,
  cz_rp_entries rpp,
  cz_rp_entries rpf
WHERE r.devl_project_id=p.devl_project_id
AND r.rule_type = 300 -- CX rules
AND rpp.object_id       =p.devl_project_id
and rpp.enclosing_folder = rpf.object_id
AND rpp.object_type     ='PRJ'
AND R.DISABLED_FLAG=0  --update only enabled rules
AND rpf.object_type = 'FLD'
--AND P.DEVL_PROJECT_ID=1037298 --add this if you want to update specific model only
AND class_name LIKE 'xxcz.cx.MyOldClass'
AND RPF.NAME LIKE 'Models – In Process'
AND r.rule_id=ru.rule_id
);

Sunday, October 6, 2013

Configurator: Deploying CX class in archive vs file system

CZ Extension java classes uploaded directly on middletier / unix box:
  1. Java extension classes are placed in middle-tier/unix file system
  2. jserv.properties (11.5.10) or oc4j.properties (R12) file should be updated to add extension classes in classpath.
  3. All published Configurator models will use same extension classes
  4. Any new change in code will require a Jserv/OC4J bounce to take effect, no model republish required
  5. Any code change will affect all published models using extension classes
  6. Any application in the EBIZ running on Jserv/OC4J will have access to all CZ Extension classes through java classpath
CZ Extension java classes uploaded through archive
  1. No changes required on middletier/unix box
  2. Classes are stored in binary format in database table
  3. Any change in CX requires archive upload on Configurator Model Development instance and ALL MODELS referring the archive needs to be published again,  no server bounce required
  4. Code change will be effective on model basis - whichever model is published will have new code.
  5. Only CZ models which are using the archive will have access to java classes, no other application of EBIZ will have access to these extension classes.
  6. These classes are loaded dynamically by Runtime Configurator 

Thursday, September 26, 2013

Configurator: Check for Model Logic Status using Plsql API

Sometimes its useful to find how many model's logic is not upto date using plsql API. One simple example would be for during republish of the model - if model logic is not upto date at the time of publication processing, publication program will fail and model will not be published. Following block can be handy before running any publication or locally creating configuration for the model using CIO API.

DECLARE
  p_model_id      NUMBER := 1774920;
  x_return_status VARCHAR2(10);
  x_msg_data      VARCHAR2(256);
BEGIN
  CZ_PB_MGR.IS_MODEL_UPTO_DATE( P_MODEL_ID =>p_model_id, X_RETURN_STATUS =>x_return_status, X_MSG_DATA =>x_msg_data);
  dbms_output.put_line('X_RETURN_STATUS = ' || X_RETURN_STATUS);
  dbms_output.put_line('X_MSG_DATA = ' || X_MSG_DATA);
END;

If x_return_status=1 then logic is not upto date, 0 value means logic is upto date.

Friday, August 30, 2013

BOM: Enable/Disable Bill Item Deletion Constraint

When we want to delete some times from BOM structure, we may get error that BOM is actively used in open orders and cannot be deleted. There are few constraints which restricts BOM item deletion. Once you get that constraint name, you can disable them temporarily from back-end using SQL queries and enable them again once deletion is complete. Of course it will create problems when the orders are referring them, but who cares when you are really in testing phase and want to delete few items from BOM before going live. This will be handy in such cases.

UPDATE  BOM_DELETE_SQL_STATEMENTS 
SET ACTIVE_FLAG=1
WHERE (SQL_STATEMENT_NAME LIKE 'CMP_CON5');

Set ACTIVE FLAG=1 for Enabling the constraint
Set ACTIVE FLAG=2 for Disabling the constraint
You can get sql_statement_name from the constraint error that you have received.

Saturday, July 13, 2013

Configurator: What is CZGOLD instance?

In Oracle Configurator world, CZGOLD terminology is coined very frequently by Oracle or experienced Configurator implementors and new guys are usually confused by this term.

CZGOLD is an instance strategy which many implementors may already be following in their implemention. CZGOLD is an instance where you import models from one BOM instance, do Configuration model development and publish to multiple different instances.

Not a picture perfect, but something similar to --

         <---------- IMPORT BOM -----<------------BOM INSTANCE
        /                                           ^
       /                                            |
CZGOLD/------->----PUBLISH BOM MODEL(Optional)--->-->
      \
       \
        \----->----PUBLISH BOM MODEL--->--ANOTHER BOM INSTANCE1
         \
          \---->----PUBLISH BOM MODEL-->--ANOTHER BOM INSTANCE2
           \
            \-->----PUBLISH BOM MODEL-->--ANOTHER BOM INSTANCE3


Benefit of having a dedicated CZ instance (CZGOLD) verses maintaining BOM/CZ along with your transactional data (Quote/OM) within a single instance:

Its always good to have a separate dedicated instance for CZ, usually referred as CZGOLD.

Configurator model development is different and standalone process. It does not have any need of transactional environment when BOM is already imported to CZ and until testing of the functionality is required in order line.
Configurator development environment will require exposure to testing of Java CX - which has killer ability to do server crash when its not fully tested or due to malfunction of code or inappropriate model setup. Definitely you would not prefer your transactional processing to be affected by model development/testing.

For Configurator development, you may need to expose unix box access, database access to Configurator model/CX developer.

When you have SR/issue in Configurator and Oracle gives fix for it, you may want to test it first in CZ test env, and not directly on the instance where transaction data is getting processed to ensure fix will work for you, and if any problem, you can report back to Oracle.

You will not prefer to affect transaction data processing performance with model development process. Keeping both of them on separate instance will be better utilization of resource and will avoid performance issues due to hardware bottleneck (agree that you need additional CZ instance but its worth doing it).

Usually companies maintain CZGOLD PROD and CZGOLD TEST instance. First do changes on Test instance and then migrate change on Prod. Now R12 Configurator has functionality called model migration, which makes it very easy to migrate model from one instance to another instance. Multiple divisions can work on their own CZGOLD Test instance and then finally migrate the model on CZGOLD Prod instance for model release.

Sunday, June 2, 2013

Configurator: Query to get list of published models

In Configurator publication target instance, we can use following query to get list of all models published to this instance which are currently active.

SELECT si.segment1 item_name, 
   mp.publication_id,
   mp.remote_publication_id,
   mp.model_id,
   mp.top_item_id,
   mp.organization_id,
   mp.last_update_date,
   mp.product_key,
   round((sysdate - mp.last_update_date), 2) as days_ago,
   round((sysdate - mp.last_update_date)*24, 2) as hours_ago,
   round((sysdate - mp.last_update_date)*24*60, 2) as mins_ago
FROM cz_model_publications mp,
   mtl_system_items_b si
WHERE 1 =1
   AND mp.top_item_id = si.inventory_item_id
   AND si.organization_id = mp.organization_id
   AND deleted_flag =0
   AND disabled_flag =0
   AND sysdate BETWEEN applicable_from AND applicable_until
   AND export_status ='OK'
   AND object_type ='PRJ'
   AND source_target_flag ='T'  --only target publications
   AND publication_mode ='p'  --list publications in Production model, replace with 't' for Test mode
   --and mp.server_id=1700  --you would need this if multiple sources were publishing to current instance in past
   --and round((sysdate - mp.last_update_date)*24, 2) < 5 --to restrict the result to last N days publications
   --and si.segment1 like 'Laptop55%' --uncomment to get details for specific models
ORDER BY last_update_date desc;

Saturday, May 11, 2013

Rename Item and Reflect change in Configurator

In  implementation, there would be scenarios when some items (option class/standard item/model) are named wrongly and need to be corrected. Usually the problem will worsen if the model is already imported into Configurator and there are lot of rules for that particular item. If you delete the item and create new one with correct name, next Configurator Model Refresh will cause issues for existing configurator rules for item. Rule will become invalid because its participant node would have been deleted. But there is a better simple alternate. Check following settings that will be helpful in similar scenarios.

Inventory Profile INV: Updateable Item Name
Oracle documentation says: This profile option controls whether the system enables you to change the item name after you save it. Setting the value to No prevents you from altering the item name after the initial save.
Inventory predefines a value of No for this profile option for all levels upon installation.
This profile option is updateable at all levels.

One more hurdle could be while refreshing the model in Configurator. Usually Configurator does not import/refresh item name change in Configurator Model.

Check following query.
select noupdate 
from cz_xfr_fields
where xfr_group='IMPORT' and dst_field='REF_PART_NBR';

If above query returns 1 means item name change import is not enabled. You can enable it by changing this field to 0 using following query.

update cz_xfr_fields
set noupdate=0
where xfr_group='IMPORT' and dst_field='REF_PART_NBR';

There are more parameters in this table cz_xfr_fields which can be of your interest depending on issue/requirement you have. Check it out by looking at all entries in this table.

Wednesday, April 24, 2013

Query to extract Oracle Configurator CX rule information - 2

Earlier post regarding CX query did not list method name. Following query can be used to find out all CX binding in the instance (you can filter by other parameters as required). Most important thing is to find all CX binding for postValueChange event for Global scope - These can cause performance issues and instance crash.

SELECT DISTINCT
  p.devl_project_id,
  p.name,
  RU.RULE_ID,
  RU.NAME,
  ev.NAME AS EVENTNAME,
  CLASS_NAME,
  mtd.name method_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,
  CZ_SIGNATUREs EV,
  cz_signatures mtd,
  cz_devl_projects p
WHERE 1                       =1
  --AND p.DEVL_PROJECT_ID          IN (1097200) --for given devl_project_id
  AND RU.RULE_ID                =EN.RULE_ID
  AND ev.SIGNATURE_ID           =EN.ARGUMENT_SIGNATURE_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 p.deleted_flag            =0
  and ru.disabled_flag=0
  and en.expr_type=216
  and en.param_signature_id=mtd.signature_id
  and en.expr_parent_id is null
  AND EN.EXPR_PARENT_ID        IS NULL --definition is only on parent node of expression tree
  --AND ev.NAME                  = 'postValueChange'
  --and EVENT_EXECUTION_SCOPE=1  -- to check which all are global events
  --and mtd.name='myProcess' --- to check CX for given method
  AND ru.devl_project_id        =p.devl_project_id
  ;

Thursday, March 28, 2013

CZ: Configurator Model Report in XML

Configurator provides Model Report functionality to view model structure, rules, properties, item types in pdf. You can generate model report in Configurator Developer > Repository > Work Bench (for any model) > General Tab > Click on Model Report button.

Also note that Configurator does not maintain model revision history; so few customers will use model report  as revision history for models to track changes in the model. But pdf model report is not good enough to maintain the history and view the delta differences between models.
In such case, customer may want to implement custom revision history and they need model data in some readable format which they can process. For such cases, you can chose to generate model report in xml format and store its revision.

Do following to generate model report in xml:

Configurator Developer > Preferences (link on top right corner besides Logout links) > Configurator Preferences

In custom init param page (last section), enter following. Here /tmp/mymodel13FEB2013.xml is the file path on unix box which will contain xml model report.

ModelReportIntermediateXMLFile=/tmp/mymodel13FEB2013.xml

Few benefits of xml model report:

  1. Maintain model revision history in single instance - keep taking xml report at certain interval and save in version control tool.
  2. Generate xml model report between two different instances and compare them to find delta differences between instances
  3. Any other processing/validation to be performed on model programmatically; although I would prefer direct table query for this.
Unfortunately xml model report does not cover UI structure.  We can get details of UI using CZInfo.jsp.

Monday, February 25, 2013

Debugging Configurator Batch Validation

When you do Book Order in Order Management, it will validate line Configuration using batch validation API. This process causes issues at times and the front end error message simply says like "Configuration validation resulted in errors." without any additional details. As this is background process, it makes debugging difficult.

Here are few important steps to debug Configurator batch validation error:

1) Generate OM debug log for batch validation process. That should reveal some detail about what is happening.

2) Generate sql trace for batch validation process. Useful in certain cases.

3) Check AltBatchValidateUrl parameter from cz_db_settings.

4) Check if above URL is reachable by Database using following script
DECLARE
  config_messages cz_cf_api.CFG_OUTPUT_PIECES ;
  finalURL VARCHAR2(500);
  MESSAGE  VARCHAR2(500);
BEGIN
  dbms_output.put_line('start...');
  finalURL        := 'http://configurator-businessappsLoad.companyname.com:80/configurator/oracle.apps.cz.servlet.UiServlet?test=version';
  config_messages := UTL_HTTP.request_pieces(url => FinalURL);
  dbms_output.put_line('message count = ' || config_messages.COUNT);
  FOR i IN config_messages.FIRST .. config_messages.LAST
  LOOP
    MESSAGE := config_messages(i);
    dbms_output.put_line('Message ' || i || ' : ' || MESSAGE);
  END LOOP;
  dbms_output.put_line('...end');
END;

5) Check if there any additional logs written in Configurator batch validation
select * from cz_db_logs 
where logtime is not null
and loguser = 'batchValidate'
order by logtime desc;

6) Check if you are using model based routing and try disabling it and see if it works.

7) If you are using https url for batch validation, you need check if Wallet setup is done correctly.

Saturday, January 26, 2013

CZ: Understanding Valid and Complete Configuration

This is very common question among Configurator Developers: What is Valid Configurator and What is Complete Configuration? What is the difference between the two?
Order can be booked with only valid and complete configuration.

COMPLETE:
Configuration is said to be complete if all mandatory inputs have been provided. Alternatively, Incomplete is referred as Unsatisfied as well. Configuration can be incomplete/unsatisfied because of node definition (Structure) or because of Rules.
For example, if there is an option feature with min/max as 1/1, then atleast 1 option selection has to made for it. If user did not make any selection, then configuration will remain incomplete. For some features, you can specify if they need user input while creating the feature. Those can make Configuration incomplete if value has not been provided.
Configuration can be incomplete due to rules as well. For example, if there is a rule like
A Implies AnyTrue(B, C)
then if A is selected in Configuration, either B or C must be selected (Configurator Original Engine cannot select any option on its own). If none of B or C is selected, configuration will remain incomplete. The rule will be said as Unsatisfied Rules, and you can chose to display your own message for it in the rule definition.

VALID:
Configurator is said to be valid if none of the rules are violated or none of the Resource is over consumed.
If there is a violation in the configuration, its status will be marked as invalid. If any integer feature has maximum defined value as 100, and if user tries to enter 200, Configurator will accept input but it will make the configuration invalid.
Usually in rule case like BomModel Requires (IntFeature <= 100) will throw immediate violation when IntFeature value entered is more than 100, Configurator does not accept value in such case - Configurator will not prevent user from creating invalid configuration.

Friday, January 25, 2013

CZ: Query to get property values associated with model node

Query to get all property values associated with all model names for given property.

SELECT DISTINCT D.NAME MODEL_NAME,
N.NAME NODE_NAME, P.NAME PROP_NAME, v.data_value text_value, v.data_num_value numeric_value
FROM cz_ps_prop_vals V, CZ_PROPERTIES P, CZ_PS_NODES N, CZ_DEVL_PROJECTS D
WHERE 1=1
AND V.DELETED_FLAG=0
AND N.DELETED_FLAG=0
AND D.DELETED_FLAG=0
AND P.DELETED_FLAG=0
AND V.PROPERTY_ID = P.PROPERTY_ID
AND V.PS_NODE_ID = N.PS_NODE_ID
AND N.DEVL_PROJECT_ID = D.DEVL_PROJECT_ID
AND P.name like '%LENGTH%' --property filter criteria
order by 1;