/** * Generate a message only if the message has not been overridden and has the same severity or * worse than the existing messages * * @param session - the Equation Standard session * @param fms - function messages to add the the new message * @param screenSetId - screen set Id * @param scrnNo - the screen where the message occurred * @param fieldName - the field that generated the message * @param sequence - sequence number * @param fieldData - the field data * @param messageText - the message * @param firstLevelText - text to be appended to the start of messageText * @param secondLevelText - text to be appended to the end of messageText * @param ignoreMessages - the message severity to ignore. All equal/lower message severity will * be ignored * @return the function message added * @throws EQException */ public FunctionMessage generateMessage( EquationStandardSession session, FunctionMessages fms, int screenSetId, int scrnNo, String fieldName, int sequence, FieldData fieldData, String messageText, String firstLevelText, String secondLevelText, int ignoreMessages) throws EQException { // get the message EQMessage eqMessage; try { eqMessage = session.getMessage(messageText); } catch (Exception e) { eqMessage = session.getMessage("KSM7340" + Toolbox.getExceptionMessage(e)); } // generate return generateMessage( fms, screenSetId, scrnNo, fieldName, sequence, fieldData, eqMessage, firstLevelText, secondLevelText, ignoreMessages); }
/** * Insert other messages * * @param session - the Equation standard session * @param screenSetId - screen set Id * @param scrnNo - the screen number * @param fieldName - the field name * @param sequence - sequence * @param fieldData - the field data * @param messageText - the message text in DSEPMS format * @param firstLevelText - text to be appended to the start of messageText * @param secondLevelText - text to be appended to the end of messageText * @return the message severity * @throws EQException */ public int insertOtherMessage( EquationStandardSession session, int screenSetId, int scrnNo, String fieldName, int sequence, FieldData fieldData, String messageText, String firstLevelText, String secondLevelText) throws EQException { // retrieve the message EQMessage eqMessage = session.getMessage(messageText); // add the message otherMessages.insertMessage( screenSetId, scrnNo, fieldName, sequence, eqMessage, firstLevelText, secondLevelText); // add the error message to the field if (fieldData != null) { fieldData .getFunctionMessages() .insertMessage( screenSetId, scrnNo, fieldName, sequence, eqMessage, firstLevelText, secondLevelText); } return otherMessages.getMsgSev(); }
// ********************************************************************************************* public void test() { // Have a bash... try { // Get us an empty customer transaction class EquationStandardListEnquiry dealSummaryEnquiry = new EquationStandardListEnquiry("DLSDER", session); // Set some transaction fields up /* dealSummaryEnquiry.setFieldValue("HZCPNC","123467"); */ dealSummaryEnquiry.setFieldValue("HZCUS", customerMnemonic); dealSummaryEnquiry.setFieldValue("HZCLC", customerLocation); /* * dealSummaryEnquiry.setFieldValue("HZBBNR"," "); dealSummaryEnquiry.setFieldValue("HZCCYR","USD"); * dealSummaryEnquiry.setFieldValue("HZCEDR","2"); dealSummaryEnquiry.setFieldValue("HZCUN","Atlantic Industrial PLC"); * dealSummaryEnquiry.setFieldValue("HZCUNA",""); dealSummaryEnquiry.setFieldValue("HZCTP","AB"); */ dealSummaryEnquiry = session.executeListEnquiry(dealSummaryEnquiry); System.out.println(dealSummaryEnquiry.toString()); } catch (Exception e) { System.out.println(e.toString()); // Rollback any transactions for the unit } }