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.