Configurator Extensions
About this white paper
This paper will talk about extending Oracle Configurator functionality by using extensions/programs written using JAVA language. This makes it mandatory for a developer to have knowledge of CORE Java. Before reading this white paper, make sure you have read through articles 1-3 on Oracle Configurator on this website.
We will be discussing about writing these java extensions and using them in Configurator Extension Rules. Using Configurator extensions we can perform additional validations, defaulting of certain values etc. This white paper will talk about things which are generally required in Oracle Configurator Development and not the complicated stuff which is given in Oracle Configurator Guides as it keeps developers away thinking that extensions too difficult to understand.
Overview of Configurator Extensions
Configurator Extensions extend your runtime Oracle Configurator by attaching custom code through established interfaces. These extensions are written using JAVA Language.
The term Configurator Extension includes the following:
-
A Configurator Extension class is the Java class containing the methods that implement desired behavior
-
A Configurator Extension instance is the event-driven execution (the Java object) of the Java class at runtime
-
A Configurator Extension Rule is the set of arrangements that you Oracle Configurator Developer to associate the CX class to a Model
Installation Requirements for Developing Configurator Extensions
-
The latest version of Oracle JDeveloper
-
The latest patch release of JDK 1.4.2 for your platform
The Configuration Interface Object
Before writing Configurator extensions it is important to understand Configuration Interface Object .The Configuration Interface Object (CIO) is an API (application programming interface) that provides programs access to the Model used by a runtime Oracle Configurator,
The CIO is a top-level configuration server. The CIO is responsible for creating, saving and destroying objects representing configurations, which themselves contain objects representing Models, Components, Features, Options, Totals and Resources.
The Oracle Configuration Interface Object is written in Java, and implemented as the Java package oracle.apps.cz.cio. To use the functionality of the CIO you must import classes from this package. All Configurator objects are represented as java class e.g
Object Name |
Java Class |
Component |
oracle.apps.cz.cio.Component |
TextFeature |
oracle.apps.cz.cio.TextFeature |
OptionFeature |
oracle.apps.cz.cio.OptionFeature |
Option |
oracle.apps.cz.cio.Option |
BooleanFeature |
oracle.apps.cz.cio.BooleanFeature |
Totals |
oracle.apps.cz.cio.Total |
Resource |
oracle.apps.cz.cio.Resource |
To use this CIO objects we need to have package oracle.apps.cz.cio in classpath. You can copy the $JAVA_TOP/oracle/cz directory to desktop local directory C:\Prasad\CZ_Extension\oracle\cz and add C:\Prasad\CZ_Extension in Local JDeveloper Class Path. The java code should import these classes before using it as shown below:
package xxcz.oracle.apps.cz.extension;
import oracle.apps.cz.cio.Component; import oracle.apps.cz.cio.TextFeature; import oracle.apps.cz.cio.OptionFeature; import oracle.apps.cz.cio.BooleanFeature; import oracle.apps.cz.cio.Total; import oracle.apps.cz.cio.Resource;
public class SampleExtension { public SampleExtension() { }
public void setDefaultTextValue(TextFeature CustomerItem){ try { CustomerItem.setTextValue("Hello"); } catch (Exception e){
} } } |
Using SQL in Configurator Extensions
With Configurator extension code, we can connect to Oracle E-Business Suite Database and perform DML actions. This is done by using java.sql package. To achieve this the import section of java extension should be as follows:
import java.sql.PreparedStatement; import oracle.apps.cz.cio.*; import oracle.apps.cz.cio.CIO; import oracle.apps.cz.cio.IRuntimeNode; import java.sql.Connection; import java.sql.SQLException; import java.sql.ResultSet; import java.sql.Statement; |
Within Java Configurator Runtime there is no need to write statements to connect to Oracle using JDBC as we can get handle to Connection Object as follows:
SQL Statements
public void queryData (TextFeature CustomerItem){ try { String sql = "Select SEGMENT1 from MTL_SYSTEM_ITEMS_B "; Connection conn = ((IRuntimeNode)CustomerItem).getConfiguration().getContext().getJDBCConnection(); Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); ResultSet rset = stmt.executeQuery(sql); while(rset.next()) { } }catch(Exception e){
} } |
Reading value for Configurator objects
public void readObjectData(TextFeature textItem, OptionFeature optionItem, BooleanFeature booleanItem ){ try { String textItemData = textItem.getTextValue(); String optionItemData = ((Option)optionItem.getSelectedOption()).getName(); double booleanItemData = booleanItem.getValue(); if (booleanItemData >= 1.0){ //True }else{ //false } }catch(Exception e){ } |
Displaying Information OR Error Messages related to Validation
<<Import Section>> <<Code Section>> public void showMessage(OptionFeature sampleFeature) |
Selecting/De-Selecting Option Feature
public void SetOptionValues (OptionFeature currentFeature,String currentValue)
|
Capturing Additional Information (Non-BOM Information) in Configurator
We can capture additional information for a given configuration by defining Configurator Descriptive Flexfield. This data is stored in CZ_CONFIG_ATTRIBUTES table. You can refer to Oracle Configurator Methodologies Guide to get the code of WriteAttributes.java and Attributes.java and use it as a part of your project. These java classes are used to write captured data in CZ_CONFIG_ATTRIBUTES table.
Setting Up Configuration Extension Rules
-
Build the java classes you have developed and create a zip file with complete class directory.
-
Please note this zip file (e.g. xxcz.zip should have the complete directory structure i.e. xxcz/oracle/apps/cz/ext.
-
Create a Configuration ExtensionArchive in Oracle Configurator Developer
-
Specify the JAVA Class Jar/Zip file
- Assign this newly created Configurator Extension Archive to your MODEL
Create Configurator Extension Rules
-
Create Rule
- Choose Model Node
- Choose Java Class
- Create Binding-Binding is assigning methods in selected to java class to specific configurator events. Events are similar to triggers in forms. There events which are used frequently are as follows:
- OnCommand- Creates a Push Button in User Interface and java method gets executed after clicking the button
- postValueChange- Similar to when validate item in forms i.e. whenever value of selected object changes this event will fire
- postConfigSave- This event will get fire after saving the configuration. e.g. writeattributes.class is attached whenever we need to save Configurator DFF information
- OnInstanceLoad- Initialize variables
- If Eventscope is Global then any object is Configurator instance changes, this event will fire.
- If its Eventscope is Base Node then any item with Base Model Node of Rule changes then a given event will fire.
- If Base Node Subtree event scope is selected then event will fire only for selected node and its sub-nodes.
Some more important points:
- Every time an event fire, configurator runtime creates a new instance of Java class and calls individual methods. So we cannot use global/class level variables.
- We can use Static variables which are bit dangerous as one value shared/modified by various instances of java class.
Conclusion:
I hope this article would have given you a breif idea about how to write configurator extension in Java. We can use these to for validation e.g by using postValueChange Event etc. With this we can plug-in any business logic to validate the configuration.
Comments
The article is a really good one. i need one information on Configurator Extensions and rules migrations. If i have about 1000 Rules, what is the easilest method to import the CX's and Rules and avoid creating manually. Kindly let me know if there is any process.
Regar ds,
Sam.
All your articles pertaining to configurator was very good and very useful.
This is the first time I work on Configurator module.
I feel, it would be better if u give a live example of a Configurator from the start (creating an item) to the end (Publishing the configurator)
The iformation which is u given is very good. I am working on configurator module i need to import the data to confgurator tables. i didnt find any API for that. Could you please advice me how we can do the data population to configurator tables. This configurator we are creating from Quote form.
Thanks
S hatagni
My company is trying to configurate ERP system and couple of custom applications. Can you please advice on this and help me with this. My e-mail address is gvikramsimhagmail.com
I am working on a project and that requires that we create a custom form /screen using JDev and take some inputs(gas components and concentrations) from the user.Then according to the inputs we conduct validations and get the required result(gas mixture) from the database.Now for this Gas mixture we will be having a BOM created ,so now we want the CONFIGURATOR UI to open so that we can apply rules on the BOM model being retrived from the previous validations.
To do this i actually want to know if it is possible to call configurator UI from a JDEV UI screen .And if it is possible what are the APIs used for it.
Please send me your contact so I can call you.
Regards,
Your article is very good.
We have few requirements from Customer on the version 11.5.9
• Develop a prototype that imports our Model Structure and Rules Master into OCD.
• Evaluate an Oracle base model, supporting functional companions and database impacts to develop recommendations that improve system performance. Develop applicable technical specifications.
• Evaluate instance management framework to develop recommendations that improve ability to manage change control while minimizing redundant master data.
Any best practices pertaining to the above 3 requirement would be very helpful
The articles on Oracle Configurator are really helpful. I am trying to understand more on the Single Model Migration part in 11.5.10. Can you please help. Can contact me at avishnu123gmail.com
thanks,
V
I have an extension tht gets kicked in when a new config gets saved.
This part works fine from the config screen while creating bom, here we are inserting error messages in a debug table for testing..
But when our another customization which gets node values from a legacy modifies and saves the configuration from Order Management Module (extension again gets kicked in here!!) but our debug messages are not inserted. CZ & APPS both have rights on our table.
Are we missing something do we have to put a java file or jar file again somewhere??
Now I am trying to default multiple types of nodes like the Boolean Feature, Integer Feature, Option Feature, etc.
The problem is, after defaulting the values of any one type, i.e., Boolean, Integer or Option, the call ends abruptly. No error,
exception is raised. It simply moves to the next level to do the defaulting. None of the function calls are getting completed
succe ssfully. Can you figure out why this may be happening?
Great article, I want to ask a question -
We have attributes in the configurator that are currently created as "Option Feature", they have lots of values and are hard to maintain this way.
Is there a way to have the drop-down list of this attribute be based on an SQL query from the DB ? If so, please advise,
I would appreciate any comment,
Thanks !
Aaron
Each ordering of PTO Model must be bundled of x5. Appreciate your advice, tq!
We have a requirement in Configurator Extension where there is an Option Feature which has 2 values "Yes" and "NO"
The minimum selection property for that OptionFeature is set to 1.
I have one method which gets fired when some temperature value changes using a rule.
The method has code to do some changes on the page including deselecting the above mentioned OptionFeature.
Now, the value whether "YES" or "NO" gets deselected and none of the options are chosen, but i am not getting the "Unsatisfied" * mark for this OptionFeature Node.
Please help with some function, i have searched the CZ Javadoc and tried many methods like
unset(), setstate(IState .LFALSE) etc....
None Worked.
Please help.
Regards
Saurabh Jaiswal
dfrpdzcvcxbnyep nys
RSS feed for comments to this post