Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
/* | Version 12.0.0 | */
/* +======================================================================+ */
/* ==========================================================================
Validation: Check if quantity for product AS54888 (inventory_item_id=149) is less than 10.
Event: Submit Approval (Error)
Event: Place Order (Error)
Message: The minimum ordered quantity for the product Sentinel Standard Desktop (AS54888)
is 10.
========================================================================== */
package oracle.apps.qot.events.quote;
import java.math.BigDecimal;
import oracle.apps.fnd.wf.bes.BusinessEvent;
import oracle.apps.fnd.wf.bes.SubscriptionInterface;
import oracle.apps.fnd.wf.bes.server.Subscription;
import oracle.apps.fnd.wf.common.WorkflowContext;
import oracle.jdbc.OracleConnection;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import com.sun.java.util.collections.ArrayList;
import java.util.StringTokenizer;
import oracle.apps.aso.schema.orderCapture.server.AsoQuotePub;
import oracle.apps.fnd.common.VersionInfo;
VersionInfo.recordClassVersion(RCS_ID, "oracle.apps.qot.events.quote");
private final static String SQL_AS54888Query = "select quote_line_id from aso_quote_lines_all "+
private final static String SQL_attribute1Query = "select attribute1 from aso_quote_headers_all ";
try{
connection = c.getJDBCConnection();
try {
cstmt.execute();
cstmt.close();
cstmt.execute();
cstmt.close();
} catch (Exception e) {
b.setResponseData(e.toString());
// The following codes perform the QA Check for business event - QA Check
if("oracle.apps.qot.events.quote.qa_check.pre".equals(eventName))
{
eventOut.append("<root>");
eventOut.append(printSummary(errorPage, true));
String[] colNames = new String[] {"QA Check Name", "Line", "Severity", "Message"};
eventOut.append("<resultstable>");
if(billToContactMsg!=null)
if(resellerMsg!=null)
tableDataLst.add("Reseller: :Warning:"+resellerMsg);
eventOut.append(printTableData(tableDataLst));
eventOut.append("</resultstable>");
eventOut.append(printPageButtons(!errorPage, errorPage));
eventOut.append("</root>");
else {
eventOut.append("<root>");
eventOut.append(printSummary("CONFIRMATION", true));
String[] colNames = new String[] {"QA Check Name", "Line", "Severity", "Message"};
eventOut.append("<resultstable>");
eventOut.append("</resultstable>");
eventOut.append(printPageButtons(false, true));
eventOut.append("</root>");
// The following codes perform the QA Check for business event - place order
if("oracle.apps.qot.events.quote.submit_entered_order.pre".equals(eventName) ||
"oracle.apps.qot.events.quote.submit_booked_order.pre".equals(eventName))
// validate AS54888
eventOut.append("<root>");
eventOut.append(printSummary(errorPage, true));
String[] colNames = new String[] {"QA Check Name", "Line", "Severity", "Message"};
eventOut.append("<resultstable>");
if(billToContactMsg!=null)
if(resellerMsg!=null)
tableDataLst.add("Reseller: :Error:"+resellerMsg);
eventOut.append(printTableData(tableDataLst));
eventOut.append("</resultstable>");
eventOut.append(printPageButtons(!errorPage, errorPage));
eventOut.append("</root>");
// The following codes perform the QA Check for business event - submit Approval
if("oracle.apps.qot.events.quote.submit_approval.pre".equals(eventName))
// validate AS54888
eventOut.append("<root>");
eventOut.append(printSummary(errorPage, true));
String[] colNames = new String[] {"QA Check Name", "Line", "Severity", "Message"};
eventOut.append("<resultstable>");
eventOut.append(printTableData(tableDataLst));
eventOut.append("</resultstable>");
eventOut.append(printPageButtons(!errorPage, errorPage));
eventOut.append("</root>");
b.setResponseData(eventOut.toString());
catch (Exception e)
b.setResponseData(e.toString());
ResultSet rs = null;
try{
statement = conn.prepareStatement(billToContactQuery);
rs = statement.executeQuery();
invoiceToPartyId = rs.getBigDecimal(1);
if(invoiceToPartyId == null)
msg = "The Bill-To Contact is not specified. Please specify the Bill-To Contact for the quote.";
catch(Exception e)
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
}
return msg;
ResultSet rs = null;
try{
statement = conn.prepareStatement(resellerQuery);
rs = statement.executeQuery();
attribute1 = rs.getString(1);
msg = "The Reseller information is missing. Please specify the Reseller Name, Contact, Phone
and Address.";
catch(Exception e)
{
msg ="Exception in payment term validation. ";
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
return msg;
ResultSet rs = null;
try{
statement = conn.prepareStatement(paymentQuery);
rs = statement.executeQuery();
accountNumber = rs.getBigDecimal(1);
paymentTermId = rs.getBigDecimal(2);
msg = "Payment Term 'Net 90' is not valid for this customer";
catch(Exception e)
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
return msg;
// validate item
ResultSet rs = null;
try{
statement = conn.prepareStatement(itemQuery);
rs = statement.executeQuery();
partNbr = rs.getString(1);
quoteLineId = rs.getBigDecimal(2);
if("TEMPITEM.".equals(partNbr))
msg.add("Placeholder Item:"+lineNbr+": Error : Please replace the placeholder item with the
correct item");
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
return msg;
}
ResultSet rs = null;
try{
statement = conn.prepareStatement(lnFlexQuery);
rs = statement.executeQuery();
attribute1 = rs.getString(1);
quoteLineId = rs.getBigDecimal(2);
if(attribute1==null||"".equals(attribute1))
}
}
catch(Exception e)
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
return msg;
ResultSet rs = null;
try{
statement = conn.prepareStatement(AS54888Query);
rs = statement.executeQuery();
quoteLineId = rs.getBigDecimal(1);
msg.add("AS54888:"+lineNbr+": Error : The minimum ordered quantity for the product 'Sentinel
Standard Desktop'(AS54888) is 10.");
catch(Exception e)
finally
if(rs!=null)
if(statement!=null)
try{statement.close();}catch(Exception e){}
return msg;
for(int i=0;i<columnNames.length;i++)
tableTitle = tableTitle +
tableTitle = tableTitle +
" </group>\n" +
" </tabletitle>\n";
return tableTitle;
int index = 1;
while(st.hasMoreElements())
index++;
" </tabledata>\n";
return tableData;
" </summary>\n" ;
return summary;
}
// Returns summary string
" </summary>\n" ;
return summary;
return pageTitleStr;