Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



Oracle Configurator Articles - IV

E-mail
User Rating: / 0
PoorBest 

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>>
import oracle.apps.cz.cio.*;

<<Code Section>>

public void showMessage(OptionFeature sampleFeature)
{
String msg1 = "This is Sample Log Message";
InformationalMessage imsg1 = new InformationalMessage(msg1,frame);
sampleFeature.getConfiguration().addInformationalMessage(imsg1);
}


Selecting/De-Selecting Option Feature

public void SetOptionValues (OptionFeature currentFeature,String currentValue)
{
//Set selected options within the model
try{
((Option)currentFeature.getChildByName(currentValue)).select();
}catch( Exception e) {
}
}


public void deSelectField (OptionFeature currentField){
if (currentField.getSelectedOption() != null){
try {
currentField.getSelectedOption().deselect();
} catch (Exception e){
}
}
}

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
After Selecting the necessary archive the General Tab for given Model will look like

Create Configurator Extension Rules

Creating Configurator Extension Rule is a multi-step process viz.
  • 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
While creating binding you will see only those Model Nodes which as having same type as java method arguments/parameters. e.g. if java method has OptionFeature as parameter then Oracle Configurator Developer will allow only OptionFeature type of nodes to be selected in binding.
EventScope can be Global,Base Node or Base Node Subtree. This is similar to form level, block level and item level triggers in Oracle Forms. e.g. postValue Change event is selected for
  • 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 (19)add
Migration Configurator Extensions
written by Sam Daniel , June 15, 2008
Hello Prasad,

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.

Regards,
Sam.
report abuse
vote down
vote up
Votes: -1
An Example for a Configurator Model
written by Josphin Chellappa , July 08, 2008
Hi,

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)

report abuse
vote down
vote up
Votes: +3
...
written by ManSa , July 10, 2008
Can you please tell me, why Configurator Developer is unable to publish the User Interface & product rules from owning Oracle instance to another Oracle instance. The moment i publish it to remote instance it cuts off the local connection. Can u pls suggest is there any other way to accomplish this.

report abuse
vote down
vote up
Votes: +1
Good
written by shatagni , July 10, 2008
Hi
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
Shatagni


report abuse
vote down
vote up
Votes: +0
Calling Oracle Configurator UI from a custom form
written by Maan , September 17, 2008
Hi
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.

report abuse
vote down
vote up
Votes: +1
...
written by Khalid Odeh , September 23, 2008
Thanks for good articles, I want you help and consultancy in Oracle Configurator ASAP.
Please send me your contact so I can call you.

Regards,

report abuse
vote down
vote up
Votes: +0
Techno-Functional Consultant
written by Sudheer Ravikanti , November 03, 2008
Hi Prasad,

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
report abuse
vote down
vote up
Votes: +0
Extension code change not getting reflected.
written by Kapil S , June 29, 2009
Hi,
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??
report abuse
vote down
vote up
Votes: +0
Configurator Extension for defaulting values
written by Disha Sathye , August 29, 2009
I have a configurator extension in place, which defaults some nodes based on the common data form in Sales Order.
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
successfully. Can you figure out why this may be happening?

report abuse
vote down
vote up
Votes: +0
Can R12 product configurator support both Product and Service configuration?
written by Gokul King , September 29, 2009
If a model has both p******s and services can R12 product configurtor support it?
report abuse
vote down
vote up
Votes: +0
Test
written by Test , August 19, 2010
Test111111111111111111111111111111111111111111111111111 11111111111111111111111111111111

report abuse
vote down
vote up
Votes: +0
Can we have atributes with drop-down list of values based on an SQL query?
written by Aaron_G , August 19, 2010
Hey,

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
report abuse
vote down
vote up
Votes: +1
How to write configurator rule to only allow ordering qty of x5, x10, x15, x20, x25 and so on?
written by Jayden , October 09, 2010
How to restrict / show error message when the ordering qty is not x5 or x10 or x15 or x20 or x25 and so on?
Each ordering of PTO Model must be bundled of x5. Appreciate your advice, tq!
report abuse
vote down
vote up
Votes: +0
How to make and OptionFeatur property "Unsatisfied" programmatically
written by Saurabh Jaiswal , November 02, 2010
Hi,

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
report abuse
vote down
vote up
Votes: +0
it is cheryl
written by fine Francesco Smalto shirts , May 14, 2011
-fine Francesco Smalto shirts smilies/smiley.gif smilies/smiley.gif smilies/smiley.gif smilies/smiley.gif smilies/smiley.gif smilies/smiley.gif
report abuse
vote down
vote up
Votes: +0
reply this topic
written by EffieAllen , June 27, 2011
When you're in uncomfortable position and have got no money to move out from that, you would have to take the home loans. Because that would aid you unquestionably. I take credit loan every single year and feel great because of that.
report abuse
vote down
vote up
Votes: +0
What? Machan? Enjoy madi
written by GT , August 31, 2011
What? Machan? Enjoy madi
report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Sunday, 15 June 2008 10:05 )  

Search apps2fusion