1 Reply Latest reply on Feb 27, 2013 2:45 PM by Kaushal Bhati

    How to capture the configuration details

    Vijay Nimmakuri
      Hi All,

      I have been trying to capture all the configuration details once the user hits the Finish button. I tried using PostConfigsave event and tried to insert the values into CZ attributes tables but could not succeed.

      Apart from PostconfigSave, is there any event to capture all the configuration details. Please share if there is any sample code.

      Note : I am not sure, Iam facing an error while testing the model with Debugger iam getting the below error. Does PostConfigSave effects with this....
      User Interface 'ORA-01403: no data found' is not up to date for model 'Prototype Product Models/Vijay's Prototype Models/'

      ************************************* Below is the sample code which iam using***************************************
      import java.sql.Connection;
      import java.sql.PreparedStatement;
      import java.sql.ResultSet;
      import java.sql.SQLException;
      import java.sql.Statement;

      import com.sun.java.util.collections.ArrayList;
      import com.sun.java.util.collections.Collection;
      import com.sun.java.util.collections.List;
      import com.sun.java.util.collections.Map;
      import com.sun.java.util.collections.Iterator;
      import oracle.apps.cz.cio.BomNode;
      import oracle.apps.cz.cio.Configuration;
      import oracle.apps.cz.cio.IOption;
      import oracle.apps.cz.cio.IOptionFeature;
      import oracle.apps.cz.cio.IRuntimeNode;
      import oracle.apps.cz.cio.NoSuchChildException;
      import oracle.apps.cz.cio.SelectionNotMutexedException;

      public class CfgExportTest {
           Configuration config =null;
           public void exportData(IRuntimeNode irn){
                Configuration config = irn.getConfiguration();
                String value;
                IOptionFeature of= (IOptionFeature)irn.getChildByName("Select a panel"); //its one of the opton feature on UI
                IOption opt= of.getSelectedOption();
                insertAttributes(irn,config, value);
                catch(NoSuchChildException e)
                catch( SelectionNotMutexedException e)

           public int insertAttributes (IRuntimeNode node,Configuration config, String value)
                Connection conn = config.getContext().getJDBCConnection();
                PreparedStatement pStmt = null;
                int ret=0;
                try {
                String valueString = " VALUES(?,?,?,?,?)";
                String sql = insertString + valueString;
                pStmt = conn.prepareStatement(sql);
                //Bind/set values to the parameters
                // Add config_hdr_id.
                // Add config_rev_nbr.
                // Add config_item_id.
                // Add flexfield context for attribute.
                pStmt.setString(4,"CIO Integration" );
                pStmt.setString(5,value );
                // Iterate over attributes.

                ret = pStmt.executeUpdate();
                catch(Exception e)
                return ret;



      Edited by: Vijay Nimmakuri on Jan 21, 2013 3:33 PM