Showing posts with label rule. Show all posts
Showing posts with label rule. Show all posts

Saturday, May 14, 2016

Oracle Configurator - Publication Enabled Properties

Oracle Configurator build 12.1.3.31.9 has introduced a new flag for PROPERTY object - PUBLICATION ENABLED. This property indicates whether the property and its values should be copied to target publication instance during model publication or not. This is introduced mainly for performance reasons because in certain cases, properties in OCD are not required in published target model data. By default, new build sets this property to False for all properties stopping them being published to target instance. This is sudden change by Oracle in 31.9 build, which many customers are not aware of. This causes customers wonder by model not working correctly in target instance after publication and upgrade to 31.9. I have seen persons debugging a log around this for days finally to figure out properties are not copied in target instance. Thanks to Oracle that there exists a note that can help customer identify the issue quickly if anyone has searched metalink. 

After Upgrading To Build 31.9, Unable to Access Properties in Published Models (Doc ID 2084634.1)

Let's discuss about scenarios when this flag should be enabled.
  • Set Publication Enabled to True, when the property is used in UI or CX code. This means you are accessing property value in CX code OR have display/enable condition in UI based on property or have UI node caption based on property.
  • Set Publication Enabled to False, when property is used only in CDL Rules like property based rules Or property is imported in Configurator from BOM model catalog/APC and not used anywhere. This is most likely the case and is major concern in publication process performance for customers who use large amount of attribute based classification (from APC or Catalog or OCD created) for rule. Whenever you generate logic, all logic rule details are translated to rule engine language and stored in cz_lce% tables. Hence, actual rule texts and rule data are not required for rule execution in target instance.

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
);

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
  ;

Friday, May 25, 2012

Making the Configurator Features Required dynamically

Oracle Configurator provides in built support to make any option feature required at design time itself. If minimum selection of any option feature is set to 1, it becomes required at runtime (Configuration time) and user will not be finish the Configuration with complete status=true.

Sometimes you need to make option feature required at runtime - based on certain conditions (selections).
Lets say you need to make Option Feature OF (min=0) required if Boolean Feature BF is selected. You can quickly write a rule like
BF requires OF
At runtime, if BF is selected by user or by rules, OF will become mandatory selection for user.

What about other type of features? We cannot use Text Feature in rule at all. So, how to make all other features mandatory on certain conditions. Its very standard requirement and Oracle has provided a white paper on it. Please refer paper "Making a Numeric Feature a Required Input in Oracle Configurator" in Oracle Configurator White Papers [ID 434324.1]

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.